A habit is a learned response to a que which leads to a rewards. Que, action, reward.
Once the action is learned it becomes automatic. The reward is addictive. So the que triggers the action and it is near impossible to stop.
Awareness of this allows you to re-learn bad habits. You cannot (easily) change the que-reward, but you can change the action. You must identify the que and reward, then plot a new action. Ques are usually:
location, time, emotional state, other people, or preceeding action.
To identify the real que, keep a log of these five factors each time you feel the urge.
You also need to identify the real reward.
So one day, when I felt a cookie impulse, I went outside and took a walk instead. The next day, I went to the cafeteria and bought a coffee. The next, I bought an apple and ate it while chatting with friends. You get the idea. I wanted to test different theories regarding what reward I was really craving. Was it hunger? (In which case the apple should have worked.) Was it the desire for a quick burst of energy? (If so, the coffee should suffice.) Or, as turned out to be the answer, was it that after several hours spent focused on work, I wanted to socialize, to make sure I was up to speed on office gossip, and the cookie was just a convenient excuse? When I walked to a colleague’s desk and chatted for a few minutes, it turned out, my cookie urge was gone.
Likewise, to create a new habit, come up with a que – reward process