Eating habits

I'm an emotional eater. When I'm stressed, I usually look and crave those fatty food. When Im upset, I just want junk food. Happy well, ice cream/sweets lol but with that I can control. Its when I'm stressed, overwhelmed or upset I just want it and I regret it later. How do I work on that.?