By now you’ve probably read lots of articles intended to coach you through the labyrinth of temptation that is your local grocery store. Entire books are devoted to the subject, and by and large, they all say the same things: Make a shopping list and stick to it. Shop the perimeter to avoid processed foods. Never enter the supermarket hungry.

That advice isn’t bad. It addresses the psychology of grocery store setup—where certain foods are placed, for instance. But there are greater, more nuanced battles going on inside our heads that make even the most disciplined athletes falter. Once you understand what they are, you’ll never, ever grab those chocolates again. OK, maybe never. Presenting the subconscious mechanisms making you crack.

Disregard Those Healthy Labels

You may be thinking, “Duh! I see right through that stuff!” Unfortunately, that’s likely not the case. In a study out of the Cornell University Food and Brand Lab, researchers Peirre Chandon and Brian Wansink found that consumers knowledgeable about nutrition underestimate the calorie count on foods with healthy labeling just as much as people with little interest in healthy eating.

Why? Blame the halo effect. We form our opinions of a person, place, or thing based on its first and most prominent trait. That’s why the word “vitamin,” when overlaid on vibrant packaging, can make you think what’s inside must be good for you when it often isn’t. Just because something is on the Whole Foods hot bar, or wrapped in packaging stamped “organic” or “gluten free,” does not make it healthy.

The halo effect is rooted in our brain’s desire to jump to conclusions in order to save mental energy. Fortunately, we can overcome it. It just takes a little extra work, like fully analyzing a product, and thinking critically about whether it's good for us or not. Chandon and Wansink write that the best way to do that is “to consider whether the opposite health claims may be true.” In other words, whenever you come across health branding or buzzwords on food packaging, don’t just believe it—question it. If something says “healthy choice,” for example, pay extra attention to the label. Check the fat, sugar, and sodium content and make sure they are aligned with your dietary goals.

Your Wishy-Washy Goals Are Letting You Down

Increasingly popular advice to "fill up at least half your cart with fruits and veggies first" can backfire.

“There is this natural tendency that when we start to satisfy one goal, we shift to another,” says Gavan Fitzsimons, a Duke University professor who specializes in marketing psychology at the subconscious level. This tendency is particularly strong when we have abstract goals, such as “shop healthy.”

“In such cases, when shoppers look into their cart and see fresh produce,” says Fitzsimons, “they convince themselves that they achieved their goal to make healthy choices and balance it with an opposite goal that nearly everyone has—even if only at a subconscious level—which is to indulge.” This might help explain why people crack and buy candy in the check-out line after an otherwise healthy trip to the store, and why savvy marketers place the candy there to begin with.

So how do health-conscious shoppers escape that subconscious desire to indulge whenever they see a cart full of fruit and veggies? “Make your goals extremely concrete, as in I am going to make ten healthy choices and only indulge by purchasing one unhealthy option,” explains Fitzsimons. “When people make progress toward very specific goals, rather than shift to an opposite goal, we actually tend to accelerate toward our initial goal, in this case, putting healthy foods in the cart.”

Your Shopping Chart Is a Reflection of Your Own Happiness

You’ve probably heard the expression, “Don’t go shopping when you’re hungry,” but, according to Fitzsimons, it is equally important not to go shopping when you are either very happy or very sad. “The closer our mood is toward an extreme—regardless of whether that extreme is happy, sad, or any other range of emotions for that matter—the more likely we are to deviate from our plan of shopping healthy and indulge in temptations instead,” explains Fitzsimons. Generally, we crave sweet and savory foods and are drawn to bright and stimulating packaging when emotionally aroused.

The best way to shop, it would seem, is in a totally neutral mood, but don’t bet on that happening too often. As Fitzsimons puts it, “Very rarely are people cool, calm, and collected when they enter the grocery store, and even if they are, the environment of many stores is rigged to put shoppers in a happy mood.” (A screaming two-year-old, however, is just as effective at rousing the extreme emotions that lead to unhealthy purchases.) To fight the strong effect of mood on purchasing behavior, Fitzsimons’ advice is to “pre-commit to a list, and if that isn’t enough, set rules about what aisles or sections of the store you simply won’t visit.” Regardless of your emotional state, if you don’t set foot in the bakery, you can’t buy the 500-calorie muffin for a quick pick-me-up.