We repeat bad habits because they serve us in some way, and that makes them hard to abandon. The best way I know to overcome this predicament is to increase the speed of the punishment associated with the behavior. There can’t be a gap between the action and the consequences.