There are two things I find key in these situations- 1) being able to stop. This means not telling yourself "well, I ate a candy bar so I screwed up the whole day" and using it as an excuse to eat a dozen donuts
. A day can be totally turned around, even after eating junk food- at any point. You don't have to wait for the sun to rise again for a new start. You can still have the taste of chocolate in your mouth to commit to a restart. And 2) finding something else to do. First you have to figure out if you're actually hungry. Here's a tip- if you're really hungry, then you'll eat something bland gratefully. Mine is plain carrots. I ask myself, would I eat a handful of plain carrots right now? If so, then I'm probably actually hungry and just need to find something good for me to eat. If not, then I have control over my hunger because I know I'm not fighting my body, but my mind. After determining if I'm actually hungry, I'll go off in search of distraction. Anything will do, really. Just get away from those thoughts of "I failed" or "I want potato chips right now." Just find something distracting.
Hope that helps!