The solution is to ignore the bad habit and put your energy toward building a new habit that will override the old one.