shake a/the habit
1. slang To overcome an addiction, typically to drugs. It took gum, patches, and counseling, but I've finally shaken the habit—no more cigarettes. Unfortunately, the nature of addiction means that shaking the habit isn't as simple as just wanting to stop.
2. To stop any kind of habitual behavior. I had a hard time shaking the habit of snoozing my alarm every morning.