There’s a much more effective way to conquer your vices.

In Harry Potter and the Philosopher’s Stone, there’s a scene where a magical plant called Devil’s Snare captures Harry, Ron, and Hermoine. The vines wrap around their bodies like hungry pythons as they struggle to escape.

“You have to relax,” Hermione tells the other two. “If you don’t, it’ll only kill you faster.”

“Kill us faster?!” shouts Ron, suddenly struggling even more. “Now I can relax!!”

Kudos to J.K. Rowling for this brilliant illustration of a psychological phenomenon called ironic processing, in which deliberate attempts to avoid certain thoughts make those thoughts even more persistent.

Russian novelist and philosopher Fyodor Dostoyevsky famously captured this tendency in his 1863 essay Winter Notes on Summer Impressions, where he presented the experiment: “Try to pose for yourself this task: not to think of a polar bear, and you will see that the cursed thing will come to mind every minute.” There’s the irony: The more effort you expend trying to avoid a thought, the more that thought will nag at you. It will only kill you faster.

Ironic processing is a major reason thinking about bad habits can be so futile. Tell yourself not to think about biting your fingernails, and you’ll do nothing but think about chomping those cuticles. Tell yourself not to think about snacking, and your cravings will skyrocket. I’ve seen this phenomenon many times when exploring the psychology of distraction. You want to stop doing something that pulls you off track, but telling yourself not to do it only makes you ruminate on it. Eventually, when you can’t stop thinking about it, you give in, reinforcing the behavior and making it more likely you’ll do it again and again.

For example, if you’re trying to be less distracted by your phone, but you also keep telling yourself, “No, I’m not allowed to check it,” you’ll end up thinking about it so much that you just have to look. It’s like a rubber band: The harder you pull, the stronger the stress of resistance becomes, until eventually, it snaps. The same thing happens in your brain. When you finally do give in, relieving the tension of telling yourself not to do that thing feels so good. And ironically, it’s that feeling of relief that perpetuates the bad habit.

This happens with all sorts of forbidden fruit. As I discuss in my book Indistractable, the vast majority of smokers don’t want to smoke. They’ll tell you as much. Smokers overwhelmingly say that cigarette smoke stinks, the habit is expensive, and they’d rather quit. So why don’t they? Contrary to the idea that cigarettes addict people simply because of chemical hooks like nicotine, the research I cite in my book reveals that smokers are more likely addicted to the relief they get from no longer having to tell themselves not to smoke. Upon their first inhale, they release the tension of denying themselves the thing they couldn’t stop thinking about.

What’s important to know is that our perception of our thoughts spurs ironic processing. We tend to give our thoughts a whole lot of power, labeling them as either good or bad. But not every thought needs to be validated. And not every “bad” urge needs to be condemned. To be clear: I’m not disputing that habits such as smoking or excessive social media use are harmful. But the key to overcoming such vices is to realize we don’t have to get pulled into every single thought we have.

There are simple techniques that help people conquer bad habits and lessen the effect of ironic processing. One effective tactic is the “10-minute rule.” The idea here is that instead of saying “No,” you tell yourself, “Not yet.” By doing so, you acknowledge, “I’m free to do whatever I want, but not right now. I’ll do it in 10 minutes.”

For those 10 minutes, you enjoy what’s called “surfing the urge.” Let yourself experience the sensation of wanting. As the seconds tick by, don’t beat yourself up for having the urge or try to ignore it; rather, simply sit and notice it for a bit. In the moment, these uncomfortable urges seem like they’re going to last forever, but they never do. They’re like waves–they crest, peak, and subside. If you can learn to recognize the triggers and outlast the emotional peaks, you can overcome them. Remember, the goal isn’t to deny yourself—it’s to ride the wave of desire.

Sometimes, you’ll still want to do the behavior after riding the wave, and that’s fine. Go ahead! But most times, you’ll find that the urge goes away on its own. The goal is to practice recognizing the urge, processing it, and increasing your ability to delay gratification. If you learn how to master your internal triggers, you can control them instead of letting them control you.

What you should do next...

1. Subscribe to my weekly newsletter.

Get a free weekly update on my latest research, writing and best articles I find each week. Unsubscribe anytime.

Subscribe Now

2. Download my FREE Indistractable workbook:

You'll learn all about the hidden psychology driving us to distraction. You'll also receive my weekly newsletter with my latest articles. Unsubscribe anytime.

3. Pick up a copy of my #1 best-selling book:

Order Indistractable: How to Control Your Attention and Choose Your Life, available in hardcover, Kindle, and audiobook format from Amazon and retailers worldwide.