Instead of thinking of breaking a habit, consider it a process of managing behavioral and attitudinal changes creating a new habit to replace an old one.

Habit change is simple, but not always easy. It requires sustained effort and focus in other words, willpower. But you already knew that. If you’re like most people, you have failed at least once in trying to change a habit. You may even be wondering whether its worth trying again.

It is possible to succeed. Millions of people change their habits over time, although not always on the first try (especially when it comes to addictive behaviors such as smoking, overeating and shopping). The key is understanding how habits are formed, preparing yourself for challenges and applying psychological techniques in training new habits to override counterproductive ones.

How habits get established

Habits are learned patterns of behavior that get deeply ingrained through repetition and reward. Every habit has multiple interconnections throughout the brain, including the deeper areas below the level of conscious thinking.

Most habits make your life more efficient by putting routine tasks on autopilot. Imagine how exhausting it would be to think about each little step in tying your shoelaces or where to find the light switch each time you enter a dark room. You do hundreds of things like this without effort, saving time and energy throughout your day.

Other habits make your life more difficult procrastination, overindulgence, chronic lateness, just to name a few. Even though you typically feel bad later on, there is still some reward value in that burst of immediate gratification before the regret sets in.

For example, lets say you’ve resolved to quit snacking after dinner. You’re doing OK until around 8 p.m., when you remind yourself that you need to pay your credit card bills. Immediately you tense up as you think about the charges you’ve racked up in the past month, not to mention the balances carried over from the previous month.

Your default reaction is to get rid of this tension as quickly as possible. Since you’ve learned from past experience that food has a calming effect, it’s a lot more rewarding to mindlessly reach for the ice cream than to face an unpleasant task.

What Happens when you try to break habit?

Try this simple experiment: Clasp your hands together, interlacing your fingers. Notice which thumb is on top. Now try it again, with the other thumb on top. Feels strange, doesn’t it? Don’t you have the urge to go back to the way you’re used to doing it?

That’s what happens when you try to change a habit. It somehow feels not right.

Thus, the first few times you avoid snacking after dinner, you’re probably going to feel uncomfortable. Your logical mind tells you that you’re not hungry. But your emotional urge to snack is very strong.

What will you do? It all comes down to how well you can tolerate the discomfort, which depends partly on how much mental energy you have at a given moment. It takes a lot of mental energy in the form of self-control to resist a strong emotional urge.

The good news is that just like your physical muscles, you can build up your willpower muscles through repetitive practice. Muscles get fatigued with use, but when they recover they are stronger, so you can do more work with less effort. The more you practice self-control, the less mental effort it takes over time.

Essentials for successful habit change

Because willpower is easily depleted, you have a better chance of success if you also make a few tweaks in your thinking and your behavior:

Think in terms of retraining Habits are learned patterns of behavior. With frequent repetition, your new habit will override the old one and become automatic.

Minimize stress where you can Research has shown that even a few minutes of stress can reduce your capacity for self-control. Although you can’t avoid all stress, try to pace yourself where possible, and think twice before volunteering for something that will add to your stress level. Minimize contact with people who stress you out as well. Above all, don’t skimp on sleep. Fatigue is a form of stress that can quickly derail your best intentions.

Conserve your mental energy Using a budget analogy, assume you wake up every day with a dollars worth of energy. Don’t squander it on petty worries or decisions, or you may not have enough left over to resist urges and temptations.

Focus on changing just one habit at a time Each habit that you work to change requires additional mental energy and willpower. If you try to do too much all at once, you’re likely to feel overwhelmed and to give up altogether.

Expect discomfort As noted above, when you change habitual behavior, discomfort is inevitable. However, it does eventually subside. To endure the discomfort, you’ll feel stronger if you view it as a challenge rather than an affliction.

How long does it take to break a habit?

You may have heard that it takes 21 days or 28 days or some other specific time period to break the habit. But these are just undocumented opinions repeated over and over again until they are assumed to be facts.

There is minimal research data on how long it takes to change a habit, because it depends on many factors, including situational triggers, stress and the level of emotional reward or relief that your old habit provides.

Mind tricks to help your new habit stick

1. Avoid negative self-talk
Complaining can quickly drain your motivation. Instead of thinking, “This is so hard,” or “Whats the point?” substitute more empowering ones: “Its hard, but not impossible. Hang in there.” “It will be easier tomorrow. I wont be sorry I stuck to it.”

2. Reframe discomfort as a positive
Feeling uncomfortable is a sign that you are making progress toward change, and tolerating the discomfort will make you mentally stronger not just for the habit you are working to change, but also other challenges in your life.

3. Distract yourself for 15 minutes
Take a walk; answer emails; do a small task that you’ve been putting off (bonus benefit!). Focus your mind on something other than dwelling on what your emotional urges are telling you to do. After 15 minutes the craving should subside.

4. Does progress seem slow?
Focus on small units. If you’ve struggled to go three days without a cigarette, its hard to imagine how you’ll make it through the first month, let alone the rest of your life. Instead, focus on how far you’ve come, and set a short-term goal: “Three days done. One more and Ill be more than halfway through the week.” Later in the week you can say to yourself, “Just one more day and I’ll have the first week under my belt.”

5. Forgive your slip-ups
Everyone has lapses. Understand what happened, learn from it and get back to the program the next day. Don’t allow yourself to use slip-ups as excuses to give up.

6. Feeling discouraged?
Don’t have the motivation to continue? No need to make the decision today. Reread #1 and #2 above, and sleep on it. After a good nights rest you’ll have a new supply of mental energy.

Disclaimer: This article is for informational purposes only and is not intended to offer diagnosis or treatment of any medical or psychological condition. All treatment decisions should be made in partnership with your health professional.

Pauline Wallin, Ph.D., is a psychologist in central Pennsylvania, working with individuals, couples, families and businesses. She is the author of the self-help book Taming Your Inner Brat: A Guide for Transforming Self-defeating Behavior, and has written dozens of articles on how to apply psychology to everyday life. She has been quoted in national media, including the Associated Press, The New York Times, Washington Post, Wall Street Journal, USA Today, Redbook, Ladies Home Journal, Readers Digest and others.