The main thing you have to do is figure out if you're stopping this for yourself. That is because if someone is telling you to make changes that you really don't care to change, you are likely to get back into it again. Then you will want to find something to replace the bad habit. It is going to be hard, but with practice you can transform what you are doing into a force for good.
Get to the root of your bad habit. You can learn to quit it by getting familiar with where it comes from. The thing about anything you do that's bad, like drinking, is that you probably are doing it in response to something. Perhaps someone who drinks is doing so because of the stress in their lives. Maybe there's an misdiagnosed mental disorder like anxiety problems. A therapist may be a wise investment if a habit is just too hard to deal with.
1 - http://jamesclear.com/how-to-break-a-bad-habit
2 - https://www.wanderlustworker.com/how-to-quit-your-bad-habits/