Awareness is the first step. Then, find a substitute.

Research by Duke University scientists specifically suggests that habits leave certain patterns on the brain, encouraging us to repeat them over and over to satisfy cravings.

They found that areas of the brain that control motor actions and compulsive behavior in mice have two main paths carrying opposing messages. One caries a “go” signal that prompts an action, the other a “stop” signal.

The go pathways, when stimulated in this case by sugar, had a head start.

Habits can also trigger the release of dopamine. The chemical, part of the brain’s reward system, gives you positive reinforcement every time you habituate, which reinforces your desires to keep going. That may be why your fingernails are jagged stumps.

In a way, you’re reducing stress, trying to relax and feel better.

Another favorite, which is much worse for you health-wise, is snacking late at night on high-sugar, high-fat, high-carbohydrate foods.

Again, the brain is rewarding us by producing mood-raising chemicals such as serotonin and anandamide.

Since habits come in all shapes and sizes, they don’t have to involve doing anything. In fact, one of the worst, procrastinating, is exactly that.

You may procrastinate because of fear of success or failure, fear of making a bad decision, the desire for a pressure-induced adrenaline rush, or even rebelling against parents or other authority figures.

Humans have so many bad habits, a source-funded program of Pavlovian conditioning (Pavlok) used a list of 173 to make a point, with a wristband that shocks you if you engage in a self-destructive action.

How to banish these bad habits? The first step is recognition, or knowing that you have your finger up your nose, says Real Simple.

The second step is taking an action. If your habit is fidgeting, for example, get enough exercise and sleep, and try to convert “the movement of your hands and legs into isometric exercises.”

“Put your hands in your lap and concentrate on gently pushing your palms together. For your legs, place both feet flat on the floor and then push down. Do these exercises until the need to fidget subsides.”

Most of the time, bad habits are a way of dealing with stress and boredom

“Sometimes the benefit is biological like it is with smoking or drugs,” James Clear writes. “Sometimes it’s emotional like it is when you stay in a relationship that is bad for you. And in many cases, your bad habit is a simple way to cope with stress. For example, biting your nails, pulling your hair, tapping your foot, or clenching your jaw.”

You need to choose a substitute for your habit, cut out as many triggers as possible, join forces with someone to get a helping hand, surround yourself with people who live the way you want to live, and visualize yourself succeeding.

“So often we think that to break our bad habits, we need to become an entirely new person,” Clear says. “The truth is that you already have it in you to be someone without your bad habits. In fact, it’s very unlikely that you had these bad habits all of your life. You don’t need to quit smoking, you just need to return to being a non-smoker. You don’t need to transform into a healthy person, you just need to return to being healthy.”