The concept of "comfort foods" is indicative of emotional eating. It could involve binging on ice cream to sooth an emotional upset or constantly craving candy to sooth nervousness.
Not too serious now and then. But if chronically pursued, there's trouble ahead with obesity, diabetes, and poor liver and heart health among other maladies.
There are many manifestations of emotional eating habits, some are serious enough to be considered eating disorders. Binging often with junk food in short bursts then "purging" with induced vomiting is common to bulimia nervosa. Constantly crash dieting could be considered a "soft bulimia".
Many bulimic individuals, especially women, are anorexic. Bulimia puts one on the fast track toward an unhealthy, shorter life even if it's considered mild. Where the occasional binge eater may openly display his or her eating solution for tension or depression, bulimic people will go through all kinds of measures to hide their habit. 
There are some dynamics common to all levels of emotional eating. It could be a temporary solution to environmental stress or an unbearably agitated state when alone. In either case, food cravings offer an escape that must be satisfied by some level of eating beyond satisfying hunger.
And the foods that satisfy those cravings are usually very unhealthy.
Suggestions for handling emotional eating(1) Life coach Caroline Zwick recommends identifying and handling your stressors. The technique she offers is to write them down after identifying them. This puts you in a position to separate and view them. It could be environmental as in work, finances, or family and relationships. 
Or those stressors can be purely internal. Dissatisfaction with a perceived shortcoming or no progress with finding that soul-mate or life purpose career are examples of what may gnaw at you as you try to get a good night's sleep by going to the kitchen and having that pint of ice cream.
(2) Stop and think before you grab those chips, cookies, or ice creams. Do you really need it? Can you do without it? Or are you using junkas a pleasure reward-system to satisfy you? 
Occasionally indulging in an unnecessary treat is no big deal and no reason to beat yourself up. But notice how you feel after indulging. That may help discourage a cycle of habitual . [3a]
(3) Get tough and avoid processed foods, even those from health food stores. Jack Lalanne preached, "Don't eat anything with a wrapper." Instead, eat whole foods, especially organic. Fruits and nuts offer a healthier solution. You still may eat too much occasionally. But you'll gain better control over yourhabits.
You'll also be avoiding MSG, which makes you want to eat more fake food, and aspartame, which can wreck your neurological health. But if you must buy any type of processed food, put your reading glasses on and scrutinize those labels for hidden MSG. 
There are many of those Trojan Horses in packaged foods even from health food stores ().
(4) Don't eat compulsively while engaged in another activity. That's mindless eating. Watching TV or a movie and munching away or handling work while grabbing a few bites are unhealthy habits that are factors ofeating. Only eat when you eat, and take your time to enjoy it mindfully.
(5) Stop using food as a solution for stress or unhappiness. If you love music, indulge yourself wholeheartedly with the music of your choice. Strolling in nature soothes some. Taking up yoga helps center one while creating a healthy lifestyle of diet and exercise.
(6) Here's an interesting short exercise to calm and center you. You can do it almost anywhere at anytime. It's called alternate nostril breathing. It's simple, once you see it demonstrated on the video at the bottom of source  below.
Sources for this article include: