A useful exercise:
Sit, think, and consider this: when you go off a desired habit of yours, when do you usually do it?
Is it during high moods -- celebrations, victories, birthdays, holidays, parties, festivities, and happy moods?
Or is it during low moods -- anxieties, fears, doubts, losses, boredom, setbacks, and negative moods?
It's worth sitting and thinking this through. That way, you can be more vigilant during these times. If you know you tend to act stupidly, drink too much, spend money in ways you don't like, eat horribly, and treat people badly when you go to a bar when you're having a bad day... then stop going to bars when you're having bad days!
It sounds so simple when put like that, but most people don't do it.
By thinking through when you're likely to go off the rails, you can make alternative plans. For instance, "When I feel incredibly badly, instead of going and screwing up XXX important thing, I'll go buy some comic book anthologies, and just stay in drinking tea and reading comic books" -- by the way, that one actually works if you like comic books.
(Recommendations: Lone Wolf and Cub, The Dark Knight Returns)
Or, "After I close a huge deal, I'm going to call my [climbing / boxing / whatever sport] buddies and say we gotta go hang out now, instead of XXX stupid thing." (That one works too.)
Low moods or high moods? What are you going to do next time you get in that mood, instead of falling down on what matters to you?