We all know we're supposed to eat healthy portions. So why is it that a rough day at the office or even just the smell of chocolate-chip cookies can cause us to throw our best intentions out the window?

If you overeat, think about what triggered your overindulgence so you can do better next time.

We tapped the nation's leading experts for the unexpected reasons why so many of us overdo it -- so you can break the cycle and prevent an unwanted pile-on of pounds.

You're not getting enough sleep

Missing out on your zzz's not only puts you in a mental fog, it also triggers a constellation of actual metabolic changes that may lead to weight gain. A lack of shut-eye harms your waistline because it affects two important hormones that control appetite and satiety--leptin and ghrelin--says Kristen L. Knutson, Ph.D., a research associate specializing in sleep and health at the University of Chicago's Department of Medicine. Health.com: Potential side effects of sleeping pills

According to a study published in the Annals of Internal Medicine, people who slept only four hours a night for two nights had an 18 percent decrease in leptin (a hormone that signals the brain that the body has had enough to eat) and a 28 percent increase in ghrelin (a hormone that triggers hunger), compared with those who got more rest. The result: Sleep-deprived study volunteers reported a 24 percent boost in appetite. Short sleep can also impair glucose metabolism and over time set the stage for type 2 diabetes, Knutson notes.

How to get control:

When we're exhausted, we hunger for just about everything in sight, especially if it's sugary or high in carbs. That may be because these foods give us both an energy boost and comfort (since lack of sleep is a stressor), Knutson says. To quell the urge for fattening foods and still get the energy kick you need, reach for a combination of complex carbs and protein.

"If you're feeling tired, you want carbs. But go for high-fiber carbs for long-lasting energy," says Keri Gans, R.D., a spokeswoman for the American Dietetic Association (ADA). "Fiber burns slower than simple sugars, and adding in some protein keeps you satisfied longer."

At breakfast, have whole-wheat toast with egg whites or a high-fiber cereal with fruit and a yogurt. And for a food-free way to perk up during the day, take a 10-minute walk outside. You also can prevent uncontrollable cravings in the first place by prioritizing a good night's sleep -- get seven to nine hours a night in a slumber-friendly bedroom (one that's as dark and quiet as possible and reserved for shut-eye and sex only).

A final tip: If you're plagued by sleep problems, ask your doctor for a referral to a sleep specialist. Health.com: Ways to eliminate bedroom distractions and get sleep

You're sabotaged by stress

Constant stress causes your body to pump out high doses of hormones, like cortisol, that over time can boost your appetite and lead you to overeat. "Cortisol and insulin shift our preferences toward comfort foods--high-fat, high-sugar, or high-salt foods," says Elissa Epel, Ph.D., an associate professor at the University of California, San Francisco (UCSF), Department of Psychiatry and a leader of the UCSF Center on Obesity Assessment, Study, and Treatment. Health.com: Feeling stressed? Why you may feel it in your gut

Fat cells also produce cortisol, so if you're overweight and stressed, you're getting a double-whammy in terms of exposure. Overweight women gained weight when faced with common stressors such as job demands, having a tough time paying bills, and family-relationship strains, according to a study published in the American Journal of Epidemiology.

Cortisol, together with insulin, also causes your body to store more visceral fat, which is a risk factor for heart attack and stroke, Epel notes. What's more, stress makes it harder to stick with a healthy eating plan. "It's a reason why people go off diets," notes Marci Gluck, Ph.D., a clinical research psychologist at the Obesity and Diabetes Clinical Research Section of the National Institutes of Health in Phoenix, Arizona. Folks who normally restrict their eating, tend to overeat in response to stress.

How to get control:

Sure, real-life pressures can put you in nonstop-nibble mode. But working stress-reduction techniques into your busy days can really help. Yoga, meditation, and deep-breathing exercises are powerful tools that keep tension in check. And spending 20 minutes doing progressive muscle relaxation--alternately tensing and relaxing muscle groups--significantly lessens stress, anxiety, and cortisol, according to a study published in the International Journal of Obesity and Related Metabolic Disorders. Health.com: How to grocery shop on a diet

Exercise will also do the trick. "Try dancing to your favorite tunes, running in place, playing a sport, or taking a simple walk," says Elisa Zied, R.D., an ADA spokeswoman and author of "Nutrition at Your Fingertips." When you're feeling edgy, make a habit of turning to these activities rather than diving into your candy stash. If you're feeling completely overwhelmed by stress, talk to a counselor who specializes in stress management.

You've got fatty foods (literally) on the brain

We're hardwired to hunger for fatty, sugary, salty foods because, back when our ancestors were foraging for every meal, palatable eats meant extra energy and a leg-up on survival, says Dr. David A. Kessler, former commissioner of the Food and Drug Administration (FDA) and author of "The End of Overeating: Taking Control of the Insatiable American Appetite."

So it's not just a lack of willpower that's tripping you up, but rather your outdated survival mode. In fact, when you eat fat-rich foods, your brain not only gets a signal that your body is satisfied but also forms long-term memories of the experience, according to new research published in the Proceedings of the National Academy of Sciences. What once helped early humans survive is now giving us ever-expanding waistlines.

Adding to the challenge to control overeating, the mere sight of food can cue up a craving. "[Cravings] are based on past learning and memories as well as the sight or smell of food, time of day, or location," Kessler says. "You'll walk down the street and start thinking about chocolate-covered pretzels because you've had them before on the same street."

How to get control:

Avoid eating your favorite treat if you're in a particular mood, if it's a certain time of day, or if you're in a specific place; this will prevent you from creating a triggering link between those feelings or locations and that treat, Kessler says. And since the smell and sight of fatty, sugary foods is pure temptation, try to keep yourself from passing the bakery or ice cream shop you can't resist.

Also, pay attention to what you're thinking when temptation strikes. "Once the brain is activated [by a craving], having that inner dialogue of, 'No, I shouldn't have that,' only increases the wanting," Kessler notes. Instead, focus on something you want more than that slice of cheesecake--from being healthier for your kids to feeling less winded when you walk to work--to help override the urge. Health.com: Surprising myths about excess weight

If logic is out the window, indulge in healthier versions of your favorites such as low-fat frozen yogurt with almonds when you crave a sundae or a calcium-rich glass of nonfat chocolate milk when you need a chocolate fix.

You Pigged Out -- Now What?

• Forgive yourself. "Having one overindulgent meal should not derail you from your healthful eating habits, while being too negative will make you more likely to throw up your hands in despair and overindulge at the next meal or several meals for days to come," Elisa Zied, R.D., says.

• Give yourself a do-over. Immediately start with lean protein, veggies, whole grains, and fruit, and drink plenty of water, Zied suggests.

• Learn from it. Think about what triggered your overindulgence--not to punish yourself, but to choose smarter next time. "If you keep a food journal, you might see you ended up pigging out because you waited too long to eat," Keri Gans, R.D., says.

• Add on exercise. To feel in control again, simply tack on a few extra minutes to your regular walk, gym routine, etc. At the same time, "try not to think of exercise as a punishment for overindulging," Zied says. If you do, you'll grow to dread the gym

Enter to win a monthly Room Makeover Giveaway from MyHomeIdeas.com

Copyright Health Magazine 2009

All About Weight Loss • Exercise and Fitness