Every habit lives in a neural loop: cue, routine, reward. Understanding the loop is prerequisite to changing it.
The neuroscience of habits: habits form when the basal ganglia (automatic) takes over from the prefrontal cortex (intentional). The loop becomes automatic once the reward pathway is reinforced enough.