Identify what triggers your bad habits. for every trigger, make a new positive habit you can do instead.
urges to go back to your old ways will be strong. they will come in waves. the trick is just to ride out the wave. those urges will soon pass away. stay focused!