Think back to a habit you’ve been trying to break for a while. Whether it’s biting your nails, late night snacking, overspending, or constantly checking your phone, harmful habits are easy to form and much harder to shake.

If you’ve ever tried breaking bad habits yourself, you know what we’re talking about. It doesn’t just take 21 days (yes, that’s a myth) – ending a habit requires willpower, strategy, and a good understanding of how habits form (and that’s why we’re here!).

Why is that? What is it about habits that makes them so difficult to shake, no matter how motivated you are?

While it may not seem like it, habits are actually automatic behaviors, rather than well-considered decisions. Once they’re ingrained in your brain, they don’t become much of a conscious choice.

Habits exist in the first place because they’re a shortcut for our brains. Our minds are evolutionarily designed to find short routes for everything, so we can conserve energy and focus on what’s important. Once our brain notices that we perform a specific behavior over and over, a habit forms, allowing our minds to go on autopilot so our bodies can take over.

So when going through your morning routine, commuting to work, or ordering from you favorite takeout place, you probably don’t have to think very much. That’s because you’ve done this routine so many times that it’s ingrained.

Although they are huge time and energy saver, habits can also negatively impact our productivity, wellbeing, or happiness. But here’s the good news – since our habits are crafted by our minds, the key to breaking the bad ones is simply knowing the right way to communicate with our brains. It’s that easy.

Here are 6 science-backed tricks to hack your brain, and finally put an end to those bad habits.

1. Find the core of your habit

Figuring out why your habit exists in the first place is much less intimidating than it sounds. Turns out, there’s a pretty clear-cut formula behind almost any habit. Every habit has three basic parts, according to Charles Duhigg:

1. The cue – the feeling, time, or location that triggers your habit

2. The routine – the habit itself

3. The reward – the craving the habit satisfies

How Habits Work according to Charles Duhigg - Lemonade Blog

Figuring out these components is the first step to hijacking your habit. Here’s how: pay close attention the next few times your routine (read: habit) happens, and try to notice the cue and reward that prompted it. For best results, write down the cue, routine, and reward each time.

Let’s say you’re trying to break your habit of scrolling through your phone before bed, because you’re not getting as much sleep as you’d like. Ask yourself, ‘what triggers this routine?’ And, ‘what craving is my body trying to satisfy?’

The next time it happens, take notice: if you shut your lamp before right before bed (cue), picked up your phone and scrolled through your feed (routine), and felt socially connected (reward), write it all down. After a few instances, see if there’s a pattern in your behavior. If you always scroll through your phone right after you shut your lamp (cue), or notice this habit is bringing you a feeling of social satisfaction (reward), you’re onto something.

Diagnosing your bad habits will not only help you find effective alternatives (more on that later), but it’ll also help you become more aware of your habit. This awareness will transform your habit from an automatic, subconscious routine to a deliberate, conscious behavior.

2. Change your environment

Figuring out the ‘cue’ that triggers your habit is the first step to breaking it. Why? It’s what sets off your habit in the first place – without the cue, you won’t be prompted to go through the routine in the first place.

So the trick here is to eliminate the cue altogether. The best way to do this is to take advantage of a totally new environment, according to our Chief Behavioral Officer Dan Ariely. “If you move to a new place, you won’t have all of these environmental cues,” explains Ariely. “If you take advantage of a time when you go on vacation, or when you do something else for a few weeks, those are really good times to break a habit.”

The proof is in the pudding: researchers found that students who transferred to a new university were more likely to change their habits than students in the control group, because they weren’t exposed to familiar cues.

So looks like the best time to try to break a habit is during a work trip or vacation. Since your brain won’t be exposed to its typical triggers, you won’t have to fight your instincts while trying to break the habit. And once you return to your familiar environment, it’ll be much easier to continue your streak.

If you aren’t going on vacay anytime soon, another hack here is to eliminate that cue altogether in the environment you’re currently in. Going back to our phone example, let’s say you’ve figured out that shutting your lamp is the cue that prompts you to pick up your phone. Try to experiment, and see if you still crave this habit if you don’t turn your on lamp in the first place. Try to use your phone light, or bedroom light, instead. It just might be the key to breaking that habit once and for all.

3. Reframe your goal as positive

Now that we’ve tackled the ‘cue,’ it’s time to focus on another key component of habits: the ‘routine.’ As a refresher, the ‘routine’ is the behavior triggered by the ‘cue’ – it’s the habit you’re trying to shake.

Usually, when we decide to break a habit, we put our goals in a negative frame. We say we’re going to stop hitting snooze, quit biting our nails, or put an end to late-night snacking.

However, our brains’ habit system doesn’t comprehend negative goals (I will stop eating junk food) – instead, they learn by working towards positive goals (I will start eating healthy). In fact, research shows we’re more likely to achieve a goal that involves reaching a desired outcome (eating healthy) than eliminating an undesired outcome (eating junk food).

How to work towards positive goals - Lemonade Blog

Why? Psychologists say pursuing negative goals is associated with feelings of incompetence, decreased self-esteem, and less satisfaction with progress – and these emotions deter us from taking action. On the other hand, it’s much easier to become excited by the thought of reaching a positive goal, which will increase our chances of achieving it.

So rather than setting out to stop scrolling on your phone before bed, make it your goal to go to get better sleep (here’re some science-backed hacks to get better sleep). Or, rather than aiming to stop splurging on weekend brunches, set out to cook breakfast at home more often.

4. Find a replacement you’ll love

Here’s another reason our brains don’t grasp negative goals: it’s really hard for our minds and bodies to stop a habit altogether. Once a habit forms, it becomes instinctual for us to complete the routine when our brains recognize the cue and crave the reward. So telling yourself you’ll stop overspending at restaurants just won’t cut it.

Rather than trying to eliminate the habit – which almost never works – the trick is to give your brain a new routine that will replace the old one. How? Keep the old cue, and deliver the reward, but insert a new routine.

How To Replace a bad Habit - Lemonade Blog

Going back to the phone before bed example, you’ve already figured out that once you turn off your lamp (cue), you crave social interaction (reward), and that this habit is getting in the way of getting more sleep at night.

To replace this habit, you should think of another activity you can do when you get in bed that’ll satisfy your craving for social connection. Try calling a friend for a few minutes, or FaceTiming your mom before bed (bonus: it’ll make her happy!). Experiment with a few routines to see what works best for you.

Once you find your new routine, make an effort to do it each time the cue and craving hit. Since this new habit will fulfill your brain’s craving, you won’t feel much physical or psychological pushback. And the more you do it, the easier it will be for your brain to engrain this new habit – pretty soon, it’ll become second nature.

5. Tell your friends about your progress

There’s something underratedly powerful about sharing your goals with others. According to a study by the ASTC, if you tell a friend you’re working towards a goal, you have a 65% chance of completing it. If you set up a meeting or a coffee date with a friend to discuss your goal, your odds of completing it will rise to 95%. Now that’s powerful.

Why is sharing with friends so effective? Once we make a public commitment to others, we tend to feel obligated to follow through with it, due to our fundamental drive to feel that we’re consistent in our behaviors and beliefs. This tendency is called cognitive dissonance, in psychology speak.

Sharing with friends also leads to positive reinforcement. Let’s say you tell a friend you’re committed to start a habit of budgeting to spend smarter. When you tell him that you cooked brunch at home, rather than eating out, he’ll probably respond with praise. When this happens, your brain will internalize the pleasure from hearing “great job” or “I’m proud of you,” which will motivate you even further to continue spending smarter.

So when you set out to break a bad habit, text a friend – ideally one who’s also trying to break a bad habit. If you commit to telling each other about your victories and setbacks, you’ll have a much higher chance of changing your bad habit once and for all.

6. Be kind to yourself

When you set out to break a bad habit, chances are your efforts aren’t going to be perfect. It’s all too easy to scroll through your feed after a long day at work, despite your best efforts to go to bed early. Or spend that extra $30 on a brunch out, even though you’re trying to cook breakfast at home.

When (not if) this happens, the best thing you can do is be kind to yourself. If you beat yourself up, you may begin to associate your goal with negative emotions, which may interfere with your progress and motivation.

Here’s the good news: if you mess up every now and then, it won’t materially affect the habit formation process in your brain, according to a study conducted by Dr. Phillippa Lally. (How Habits are Formed) If you cave, simply jump back on the wagon, and the habit-forming will continue as if it was never interrupted.

In fact, making a mistake is actually a productive step in your quest to breaking your habit – it’ll teach you a new lesson about your habit that can inform your strategy. If you’re trying to stick to a healthy diet but cave during a business dinner or times of high-stress, you’ll learn to prepare yourself for next time. Chances are, this experience will lead to greater success in beating your negative habit once and for all.

Time to hack your brain!

We all have that habit we’re trying to shake, but setting out to stop just won’t cut it. Our brains are the most powerful organ in our body – and once a habit is engrained, the only way to break it is to communicate with our brains in a way they’ll understand. With these hacks and tools, you’ll stop replace your habit in no time, and who knows – maybe this replacement will improve your life in a way that surprises you.