The first thing I would suggest is that you eat three substantial and healthy meals a day, and two snacks in between if you wish. Be conscious about the time of day when you have your meals.
When you feel emotional pain, recognize that eating something will not make the pain resolve itself. Reaching for food to ease the physical hurt of emotional pain is sort of the same as taking an aspirin for a headache. It will not cure the underlying cause, it will just ease the physical hurt temporarily.
Allow yourself to feel the hurt inside your body without reaching for food to ease it. Cry if you have to. Give your body permission to feel the pain.
This may be very difficult to do at first, but over time, it will become easier to recognize that emotional pain can only be fully resolved by it’s awareness, and thorough, constructive expression. A wise man once said, “The only way out is through.”
By eating, it seems like that is an attempt to nourish (and therefore heal) the part that hurts. But in order to heal, the pain needs cleansing, not nourishment.
All the best to you.