How can hypoglycemia be treated?

Depends. The most common type is caused by eating foods with too much sugar. The body makes too much Insulin in response, and your blood sugar goes down suddenly. Eat more protein, and much less starch, and no candy. If it caused by too much Insulin in a diabetic, it is an emergency. Take glucose gel or pills quickly, and have your doctor adjust your Insulin dosing.
4 reactive hypoglyce. Eat only meat or fish or cheese or eggs or poultry and low starch veggies, drink only water. In other words avoid all carbs, carbs will only briefly raise your sugar levels and then your Insulin levels. The fats in the meat or fish or cheese or eggs or poultry will act like a "log on your metabolic fire" to keep your blood sugar stable for hours without raising insulin.