I've had to break a lot of bad habits. Specifically with smoking it's a bit complex because there is a real physical dependence there. That being said, for most people the psychological addiction is actually the harder one to break.
My number one tip for breaking a bad habit is to not do that at all. Instead, focus entirely on building new good habits, and use your current bad habit as the reward mechanism. As long as you're building healthy habits, eventually they will improve your health, mood, attitude enough, that you can make a serious attempt at quitting the bad habit for good.
Most people who are doing something unhealthy and try to quit fail. They fail because they don't have an internal support system prepared to handled the change. Make sure you're healthy as possible, this will give you a good chance of succeeding.
If you have more questions feel free to ask!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.