Nobody’s perfect. We’re all shaped by our genetics and environment and susceptible to developing unhealthy behavioral patterns. Whether it’s compulsively checking social media, over eating, smoking cigarettes, drinking or doing drugs, the brain learns to associate certain acts with emotional comfort. The process is actually a learning disorder, one where the brain becomes wired to skew information, but—here’s the good news—we can reverse it.

How does a bad habit take hold? Let’s use food for a simple example of how the brain can lead us astray. When we see something delicious, the mind is programmed to think, “yummy.” And when we eat, we usually feel good because of the extra calories coursing through our system. So, as this process repeats, “yummy” correlates with feeling good.

But then at some point—maybe when we’re feeling anxious, abandoned or overwhelmed—the brain looks for a way to feel good again and remembers that eating does the trick. Eventually, if we eat during these situations often enough, the emotional trigger (feeling stressed, sad, etc.) sends us to the refrigerator when we’re not even hungry. In this scenario, eating becomes the source of comfort, love or safety we lack.

With other habits, it’s the same process, Most anything—compulsively checking social email, nail biting, shooting heroin, watching TV, shopping, drinking alcohol and much more—can become associated with an emotional trigger.

Bad habits can develop quickly (especially as adolescents when the brain is still forming) because the prefrontal cortex knows which behaviors aren’t healthy, but it’s also the first part of the brain that shuts down when we’re stressed. Research also shows that addiction alters the interactions between other regions in the mid-brain that are associated with pleasure.

Enter mindfulness. Judson Brewer studied whether mindfulness could help people quit smoking. He found that mindfully smoking makes people more aware of reality and what they already know, which is that smoking is not healthy or particularly pleasant. For example, here’s the reaction from a person who was smoking mindfully:

mindful-smoking

According to Brewer, “When we get curious, we abandon fear and become more present.” He encourages his participants to become detail-focused scientists, examining their own data. Cravings are made up of sensations in the body. With mindfulness, he asks smokers to acknowledge these responses piece by piece and then feel the joy of letting it go.

Does it work? In one of Brewer’s studies, mindfulness training was twice as effective as the American Lung Association’s Freedom from Smoking program. At the end of four weeks, 36 percent of the mindfulness training group had quit smoking, versus 15 percent of the Freedom From Smoking group. After 17 weeks, the success rate was 31 percent versus 6 percent. The results were published online in July 2011 in the journal Drug and Alcohol Dependence.

The same principles apply to other bad habits. If we’re able to examine each moment mindfully and notice what’s really happening—and maybe even what’s triggering the urge—we can break old habits by changing the brain’s wiring. This isn’t to say it’s easy. Perseverance is an asset. As Brewer says, “Notice the urge. Get curious. Feel the joy of letting go. And repeat.”