Habits, like most other things, can be a help, or a hindrance, and are loved by nature because they are so energy efficient. They function automatically, bypassing the need to think, assess, decide, etc. This is lovely stuff, unless it’s a negative habit. Then what?
What you are experiencing, is perfect subconscious-mind behaviour, in that it is done, really well, without thinking. So, it isn’t likely to shift, just because you understand why you do it.
If you think in terms of, “Problem, Reaction, Solution”, where the “Problem” is the Stimulus, the “Reaction” is the Habit, and the “Solution” is the Pay-off, you’ll realise that the “Habit” is not the “Problem”.
People struggle to alter a Habit when, what they really need is, a no-nonsense approach to locate and un-hook the real cause of the trouble.