Replace your bad habits with good ones
Get rid off the triggers that push you towards the bad habits
Join with people who also want to get rid off their bad habits
Surround yourself with the people who live the way you want to live your life.