A good way to break a bad habit is to increase the difficulty of engaging in it. Want to stop drinking? Maybe start by moving the alcohol to a high shelf in the garage that you need to unfold the stepladder to get to. Keep your cigarettes in the trunk of your car instead of your purse. Put the cokes behind the 0-cal soda water in the fridge. That sort of thing.
Friction also comes into play when trying to establish new good habits. Get as many obstacles out of your way as you can and make it easier to do the desired thing by default.
“Much of the battle of building better habits comes down to finding ways to reduce the friction associated with our good habits and increase the friction associated with our bad ones.” — James Clear