You also need to recognize that you're probablyTheLight Code Review going to fail at least once or twice in your attempt to change the habit. This is alright, and you need to understand that it is alright so that you don't beat yourself up or get discouraged when it happens. There were habits that I tried to ditch a half dozen times before the new healthy habit stuck. It's not important that you get it right the first time, it's important that you learn from each attempt until you know enough to succeed.
Keeping yourself acutely aware of the negative consequences of your bad behavior can help keep you from validating and continuing a behavior. Negative reinforcement can be really helpful in changing behavior. If you want to change your exercise and eating habits so you reach a decent weight, then having a bunch of photos in an accessible place of people who did not ever change their habits can be a big motivator. Often all I have to do is think about people who engage in my bad habits in a much worse, or more sustained, manner and that helps shock me out of me laziness.
In a similar vein, it's a good idea to load yourself to the brim with positive role models. Identify people who have the positive habits and attributes that you wish to introduce into your life and keep them in mind. Learn their stories- this is often even more helpful if they started out in a similar place as you, if they struggled with the same shortcomings and negative habits that you once had. It's a good idea if at least a few of your positive role models are people whom you can have regular contact with, people who will actively support you and help you on your journey.