Motivating myself to stick to healthy habits.

I know a lot of the things I need to do for myself and that they work with persistence - drink lots of water, walk 40 mins every day, eat healthy, do stretches, but my problem is motivation.  I put myself on a program but things always seem to go off the rails after a little while, especially if I have a big glass of wine with my dinner!

I am like a kid at times - sneaking chocolates during the day, even though I know it's bad for me!  Sometimes if I get on a good streak I can be quite healthy - but this year is a bit of an annus horribilus for me.

Any tips?  Anyone out there know how to motivate themselves in maintaining healthy habits?