What just happened? You were clobbered by a food craving. In a study from Tufts University, 91% of women said they experienced strong food cravings. And willpower isn't the answer. These urges are fueled by feel-good brain chemicals such as dopamine, released when you eat these types of foods, which creates a rush of euphoria that your brain seeks over and over. What you need is a plan that stops this natural cycle—and helps prevent unwanted weight gain.

The next time you're hit with an insatiable urge for a double-chocolate brownie, ask yourself these four questions to get to the root cause, then follow our expert tips tailored to your trigger.

1. Ask yourself: Am I stressed out?When you're under pressure, your body releases the hormone cortisol, which signals your brain to seek out rewards. Comfort foods loaded with sugar and fat basically "apply the brakes" to the stress system by blunting this hormone, explains researcher Norman Pecoraro, PhD, who studies the physiology of stress at the University of California, San Francisco. When you reach for food in response to negative feelings such as anger or sadness (like potato chips after a fight with your spouse), you inadvertently create a powerful connection in your brain. Remember Pavlov's dog? It's classic brain conditioning. "The food gets coded in your memory center as a solution to an unpleasant experience or emotion," says Cynthia Bulik, PhD, author of Runaway Eating and director of the Eating Disorders Program at the University of North Carolina Chapel Hill. Face that same problem again, and your brain will likely tell you, "Get the Cheetos!"Do this:Stimulate happiness. "Women especially have a profound emotional reaction to music," notes Bulik. She asks her clients to create upbeat playlists to listen to whenever a food craving strikes. The songs provide a distraction and an emotional release. Wait it out. "People give in to cravings because they think they'll build in intensity until they become overwhelming, but that's not true," says Bulik. Food cravings behave like waves: They build, crest, and then disappear. If you can "surf the urge," you have a better chance of beating it altogether, she says.Choose the best distraction. "What you're really craving is to feel better," says Linda Spangle, RN, a weight loss coach in Broomfield, CO, and author of 100 Days of Weight Loss. You've heard the trick about phoning a friend or exercising instead of eating. But "taking a solo walk won't help if you're feeling lonely," says Laurie Mintz, PhD, a professor of counseling psychology at the University of Missouri. Instead, identify your current emotion—bored, anxious, mad—by filling in these blanks: "I feel ____ because of ____." Then find an activity that releases it. If you're stressed, channeling nervous energy into a workout can help; if you're upset over a problem at the office, call a friend and ask for advice.

If you're eating fewer than 1,000 calories a day or restricting an entire food group (like carbs), you're putting your body in prime craving mode. Even just three days of strict dieting decreases levels of the appetite-reducing hormone leptin by 22%. Experts note that "restrained eaters"—dieters who severely limit calories or certain foods—aren't necessarily thinner than regular eaters; they're actually about 1 to 2 BMI points higher, or the equivalent of 10 to 20 pounds, as their self-imposed food rules often backfire. According to research from the University of Toronto, restrained eaters are more likely to experience cravings and to overeat the "forbidden" food when given the chance. In a study from the journal Appetite, women who were asked to cut carbs for 3 days reported stronger food cravings and ate 44% more calories from carb-rich foods on day 4. "Making certain foods off-limits can lead to obsessing and bingeing," notes Kathy McManus, RD, director of nutrition at Brigham and Women's Hospital in Boston.Do this: Lift any bans—safely. Plan ways to enjoy your favorite foods in controlled portions, says McManus. Get a slice of pizza instead of a whole pie, or share a piece of restaurant cheesecake with two friends.Don't "eat around" food cravings. Trying to quell a food craving with a low-cal imitation won't satisfy your brain's memory center, says Marcia Levin Pelchat, PhD, a researcher at Monell Chemical Senses Center in Philadelphia. For example, if you're craving a milkshake, yogurt won't cut it—especially if you've been depriving yourself. You may even take in more calories than if you'd just had a reasonable portion of what you wanted in the first place. Munching five crackers, a handful of popcorn, and a bag of pretzels, all in the name of trying to squash a craving for potato chips, will net you about 250 more calories than if you'd eaten a single-serving bag.

3. Ask yourself: Am I getting enough sleep?In a University of Chicago study, a few sleepless nights were enough to drop levels of the hormone leptin (which signals satiety) by 18% and boost levels of ghrelin, an appetite trigger, by about 30%. Those two changes alone caused appetite to kick into overdrive, and cravings for starchy foods like cookies and bread jumped 45%.Do this:Have some caffeine. It can help you get through the day without any high-calorie pick-me-ups. It won't solve your bigger issue of chronic sleep loss, but it's a good short-term fix until you get back on track.Portion out a serving. You probably don't have the energy to fight it, so try this trick: Before you dig in, dole out a small amount of the food you want (on a plate) and put the rest away.

4. Ask yourself: Am I a creature of habit?You may not realize it, but seemingly innocent routines, such as eating cheese popcorn while watching TV, create powerful associations. "The brain loves routine," says Bob Maurer, PhD, author of One Small Step Can Change Your Life. The thought of letting go of these patterns can cause a fear response in an area of the brain called the amygdala. "Once the food hits your lips, the fear response shuts off in a heartbeat," says Maurer.Do this:Eliminate sensory cues. Smells, sights, and sounds all act as powerful triggers. Watch TV in your basement or bedroom so you're far away from the kitchen full of snacks.Picture yourself healthy. Try Maurer's "stop technique": Every time the food you crave pops into your head, think, Stop! Then, picture a healthy image (say, you lean and fit). After a while, your brain will dismiss the food image and the craving will subside. "One of my clients did this four or five times a day, and within 2 weeks, she stopped turning to sweets every night after dinner," he says.Shift your focus. Australian researchers found that distracting your brain really does work. When a food craving hits, divert your attention to something visual not related to food, like typing an email.