The tenacity of a certain habit or behavior can be illustrated by how many times you have made the same New Year's resolution to deal with it. Maybe you want to stop going to the vending machine for something chocolate when you have a deadline, or quit biting your nails as you sit at the computer, or not go shopping when you should be attending to something that has to be done. Discontinuing or curtailing a behavior that may comfort you during stressful times--the purpose that habits often serve--can be difficult.
What automatically seems to trigger such habits or behaviors is the emotion of anxiety. Understanding your anxiety, and using it in a healthy and productive way, rather than responding with a habit or a certain behavior that is not particularly constructive, is necessary if you want to make a change.
Emotions, such as anxiety, provide you with information that can help you to make decisions, take action, and achieve your goals. Your brain has the ability to size up circumstances and automatically create an emotional response that is experienced cognitively and physiologically. When you are anxious you're prompted to be more alert. You can feel it in your body as restlessness. The most important purpose of this process is to give you information about a situation that can help you to decide what to do--an action you should take or a goal you should pursue. You may not always feel in control of your response to the emotion of anxiety and the energy it gives you. A habit of running to the vending machine for chocolate is simply responding to what the emotion is telling you; that is, it's telling you to take action, but the action that you are taking at the time may be misguided.