Everyone has bad habits they would like to break. Some people smoke while others spend too much time on Facebook. Some people procrastinate while others stay up too late binge-watching Netflix. Sometimes the habits people wish to break are essential to improving a person’s life, such as quitting smoking or beating a social media addiction. Other times, the bad habits are small and merely a nuisance. Regardless of the severity of the habit or the impact it has on a person’s life, bad habits haunt everyone. Unfortunately those irksome habits are very difficult to break.

It is not a dearth of willpower that keeps people trapped in bad habits. It is the fact that habits bypass the decision making part of the brain. Habits are governed by the basal ganglia, the part of the brain which plays a key role in developing emotions, memories and pattern recognition. Behaviors tied to this part of the brain circumvent the prefrontal cortex, the part of the brain that deals with conscious decisions. While it is an advantage when people do not have to think about automatic behaviors such as parking their car, breaking a bad habit would be much easier if the prefrontal cortex was in charge.

All habits are composed of three main parts that form a loop: a cue, a routine and a reward. The cue is the trigger for the habit. Many people have habits that are triggered by the time of day, such as watching TV after work. The routine is the actions the person takes. It is what most people would identify as the habit itself. A familiar routine might be that a person always buys a candy bar when they walk past the vending machine. The reward is what a person consciously or subconsciously craves and is what powers the habit. In the case of the vending machine example, the reward could be the energy from the chocolate, the taste of the candy or something as seemingly-unrelated as a break from work.

Identifying the different parts of a habit can be difficult, but once a person has isolated them, they can begin to unravel the habit loop they are trying to conquer. Untying a habit loop, however, will not be the process of a single day and will be challenging. Here are eight tips to help break bad habits.

Replace It With a Good Habit

This is perhaps the best way to beat a bad habit. Once a person has identified the cues and routines involved in their old habit loop, they can being to choose new behaviors to replace their old ones. Conscious decisions, however, will eventually cave to old habits. So, a person looking to beat a bad habit should aim to make their new, better choices just as automatic as their old habits.

A person may wish to break their habit of getting a candy bar every afternoon at work. Once they examine their habit loop, they discover that what they were really craving was the chance to leave their desk and stretch their legs by walking upstairs to the vending machine. In this case, they could replace their candy-bar habit by going downstairs and walking around the parking lot. Over time, this habit would become just as automatic as getting a candy bar, and the person would no longer have to remind themselves to walk downstairs instead of upstairs. They would simply walk downstairs and outside without really thinking about it anymore.

Find an Accountability Buddy

Most people hate having to admit that they have a problem. They would prefer to stick their heads in the sand or handle an issue themselves. Unfortunately, this does not always work when a person is breaking a bad habit. People get tired and follow an old routine because it is easier. They forget to follow a different pattern before it become automatic and look up to find themselves in the cafeteria instead of outside. When there is no one else involved, a person can shrug off their mistakes. There are no real consequences to backsliding, and slowly, the old habit takes control again.

Having an accountability buddy gives a person a sort of safety net. Rather than thinking that “this one cookie is no big deal,” they have someone to remind them that no, they can’t have the cookie. Involving another person in the process of breaking a habit introduces an extra layer of accountability. No one likes to admit that they made a mistake, and having an accountability buddy capitalizes on that dislike.

Remove Temptation

Plenty of people have all the determination in the world to break a bad habit. They have a plan, they have an accountability buddy and they have loads of motivation. They also keep extraordinary amounts of temptation in their house. A recovering alcoholic would not keep a bottle of whisky in their house, but people who are trying to curb overeating keep bags upon bags of snack foods in their cabinets. When breaking a bad habit, remove the temptation and the ability to follow through on the habit. When trying to break bad eating habits, give the packages of cookies and the bags of potato chips to a neighbor or friend. Get them out of the house. When breaking a social media habit, delete the Facebook and Twitter apps. This way, the old routine is harder, if not impossible, to follow. It’s hard to eat unhealthily when there is nothing but vegetables and chicken in the house. Just be sure not to find temptation elsewhere, like stopping at McDonald’s on the way home from work.