With time, the trigger that led you to the unwanted behavior will be linked to the desired one.
Think about what triggers you to perform unwanted behaviors.
For example, it could be a McDonald’s sign triggering you to eat fast food.
Think about what would make you decide not to engage in that unwanted behavior.
In this example, it could be the image of looking at yourself in the mirror after gaining weight that terrifies you. In contrast, you could think about how your body would look if, instead of eating McDonald’s, you went to the gym.
Every time you are triggered to do something that you want to avoid, remind yourself of your chosen image.