How did you get over your last relationship? How did you get over your pet’s death? Why did you stop missing lectures in college for a particular lecture?
We as humans get attached to things a lot easier than getting detached from things.
For example, you sleep late at night which usually results in an additional snack causing weight gain.
So you develop a habit of playing badminton early in the morning with your family or/and friends and in a few days or weeks your circadian rhythm gets better and you start sleeping at a reasonable time.
During my school days, I was a sports fanatic. Though in 11th and 12th grade I started dedicating myself towards studies and as soon as I got good grades, my attraction towards sports reduced.
The best way to get over a bad habit is to find a good one and stick with it.