They probably used regular insulin IV to lower the blood sugar in the ED. I gave lots of it when I worked in the ED. You have faster and more accurate control of the blood sugar. Only regular insulin can be given IV, all others are given SQ or IM. That is too slow acting for the ED and too variable of control.
The first drug prescribed is usually metformin PO, along with diet control and exercise. If it doesn't work or can't be tolerated, then you progress to the newer PO drugs such as the semiglutides or Jardiance. Insulin is usually last, although some recommendations are to use it earlier to avoid long term effects of diabetes such as eyesight damage or neuropathy. Diabetic education and meeting with a dietician are really good ideas, especially if your insurance pays for it.