We all have days when we’re grumpy and stressed, when all we want to do is dive into a pint of Ben and Jerry’s (or an entire bag of Pepperidge Farms Mint Milano’s—don’t judge.) to ease our sour mood. It’s called emotional eating, a.k.a. stress eating, and it takes serious willpower to avoid. It’s common knowledge that your mood can swiftly sway your food choices, we never understood why—until now.New research from the Cornell Food & Brand Lab, released today, explains how our mood controls the foods we crave—and ultimately consume. Here are the Cliffs Notes:

When you’re in a good mood: You make better food choices because you’re thinking about the future and how what you eat will affect it (i.e. you’re going to choose oatmeal for breakfast over an egg sandwich to prepare for months-away shorts season).

When you’re in a bad mood: Your focus shifts to the immediate sensory experience of eating. Reaching for fatty, indulgent food gives you an instant feeling of comfort by boosting the feel-good brain chemical serotonin. It’s a subconscious remedy to your grumpiness.Even the most health-obsessed eaters will still fall victim to their mood. “At the end of the day, how you feel will determine in the moment if you will eat an indulgent food like cookies or cake, no matter if you ‘know’ it is healthy or not,” says Dr. Susan Albers, a licensed clinical psychologist at the Cleveland Clinic Family Health Center and author of “EAT. Q.: Unlock the Weight-Loss Power of Emotional Intelligence. Which is why it’s so important for researchers to study the relationship between food and feelings. “Unraveling that complex connection is what truly makes a difference to improving your eating habits,” Albers adds.What can you do about it? In the heat of your food frenzy, redirect your focus. Here’s now:

1. Focus on the short-term benefits.“We are very motivated by short-term gains rather than long-term ones (healthier in the future). We want to know what is the benefit to me right now,” Albers says. (Which is why we spring for the junk). Instead of harping on taste, think about how you will feel if you choose a healthier food: less bloated, proud of your choice, no guilt.

2. Perform a mini-mood check before you take your first bite.“This can help you assess your vulnerability level,” says Albers. “If you are at high risk move away from the kitchen quickly!”

3.  Remember to eat mindfully.Albers recommends using what she calls the “5 S Approach”: 1. Sit down; 2. Smell the food, use all your senses; 3. Slowly Chew; 4. Savor. “This breaks you out of autopilot eating, or mindless overeating,” she says, which can happen when we’re in a bad mood and not thinking enough about what we’re eating.

4. Treat food abstractly.“Call it food rather than “delicious chocolate dessert” suggests Art Markman, YouBeauty Psychology Advisor. Use general language rather than specific language when talking about food. 

5. Close your eyes for a moment.Or focus on a neutral item, such as a painting. “There is research that suggests that closing your eyes helps block out extra stimuli so you can make a better food decision,” suggests Albers. By reducing your sensory stimulation, or shifting it elsewhere, you can think deeper about how your choice will affect your overall health.

6. Write down your feelings.Keep a daily log for one week, says Albers, so that you start to actively think about how you are feeling every time before you eat. “You will start to notice a pattern to how your feelings impact the quality of your food choices.” And when you understand how your feelings drive your decisions, you’ll be able to control them more effectively.

7. Go for a quick stroll.“The first thing I tell my clients to do when they’re upset is to take a quick walk around the block,” says Mary Pritchard, Ph.D., a psychology professor at Boise State University and a holistic health counselor who has done extensive research on the psychology of eating. “When they come back, they often find that their negative energy has dissipated greatly and they no longer crave whatever unhealthy food they were craving 5-10 minutes before.”