They’re called comfort foods for a reason, right? That bag of chips, bowl (or carton) of ice cream or extra slice of pizza can seem like our only friends in the world when we’re stressed, sad or otherwise at the end of our rope. But the problem is, these so-called comfort foods usually make us feel uncomfortable afterwards—either with guilt from blowing our diet, or from the very real physical effects of eating unhealthy food.

That helping of whatever bad food you just ate sure tasted good. But even before you were done eating it—or maybe even before you started—you knew you’d regret it. And then afterwards, sure enough, you regret it. That’s the vicious cycle with comfort food. It’s typically packed with some combination of calories, fat, sugar and carbs. So for women especially, the pleasure usually isn’t worth the subsequent pain of feeling guilty for eating something bad. The end result? That soothing snack you reached for when you were down in the dumps actually made you feel even lower.

The problem is that few of us seek out healthy food when we’re feeling low. How many women do you know who opt for a nice glass of carrot juice or some celery sticks when they’ve just broken up with a boyfriend or argued with their mother?

Read Related: 7 Happy Foods to Elevate Your Mood

Since most comfort foods are packed with sugar and carbs, they produce a sugar rush that will give you an energy boost. But that little lift is short-lived. Afterwards—in as few as 15 minutes—comes the inevitable crash—the drop in blood sugar levels that leaves you feeling lethargic and ready for a nap, and probably in worse shape than you were before you indulged. Simple carbohydrates, such as rice and foods made from white flour, quickly convert to sugar in the body and have the same spike/crash effect.

But that’s not the only way carbohydrates trick us into thinking they’re doing us a favor. Carbs also produce a serotonin boost which can elevate mood. In fact, researchers are investigating this as the prime factor in comfort eating. It’s not just that we think comfort food makes us feel better; it actually does…until the guilt and sugar crash kick in. 

The secret to beating the comfort food trap is, of course, to just not go there. You can keep your pantry bare of all temptations, but that may be harder to do if you have kids, roommates, or a spouse who eats what he wants without worry. So here are some realistic ways to stop the cycle of comfort-crash-guilt.

  • Don’t go too long without eating. When you’re starving, what are you more likely to reach for—and apple, or a slice of apple pie (a la mode, of course)? Instead of raiding the fridge when you’re famished, don’t allow yourself to get to that point. Eat balanced meals and healthy snacks frequently enough so that your growling stomach doesn’t talk you into some bad decisions.

  • Indulge a little, not a lot. There’s no sin in eating a cookie or two, and you probably won’t derail your diet by doing so. Answer your craving by eating a small portion of comfort food instead of a whole package. One way to control portions? Put two cookies, one slice of pizza, or a spoonful of macaroni and cheese on a plate and leave the kitchen. That way you won’t stand at the kitchen counter helping yourself to “just one more.”

  • Find a healthy alternative. Sure, it may not offer the instant gratification of chips and ranch dip, but carrot sticks and hummus—just as an example—can be a satisfying, filling snack, and it’s certainly a healthier choice. Keep cut up vegetables, fruit, non-fat whip cream and other low-cal indulgences on hand and you’ll be less tempted to sin with salty, fatty choices.

  • Change your mindset. The more we associate feelings with food, the more likely we are to seek out comfort food when we’re stressed, upset or depressed. It’s only by breaking this association that can we break out of the comfort food trap. So next time you’re feeling angry, trying hitting the gym or going for a run (instead of going on a beer and pizza run). Walk the dog when you’re feeling stressed, and use the time to sort out feelings or look for solutions. And when you’re depressed, engage in some activity that you know will make you feel better—and for longer than it takes to eat a half gallon of ice cream.