For me, sometimes when I’m dealing with behavior I want to stop, it helps to use a habit tracker app to track how long I’ve gone not doing it.
So I set the app to say “no more doing x”. And the counter would start counting seconds, minutes, then hours and days, weeks and months. At first it’s so hard, but it gets easier and easier as the counter counts up.
So whenever I would have the compulsion to do x, I would look at the tracker and say: look, I’ve gone a half hour without doing out. It makes me feel like I’m DOING something, which I have such a strong urge towards. Action. It’s inaction that’s so difficult.
At first I usually am just focused on counting bits of time, and as the compulsion lessens, I start to focus on shifting priorities. Where can I channel my energy instead? Working, a book, a treat, an exercise. I’d push myself pretty hard to redirect my energy. I’ll often keep looking at the timer in the early days and with time I will forget about it. I have a timer to quit too much coffee that’s at like years, have forgotten about it!
For me this helps deal with early days of trying to change a behavior because I’m intense and can need a strong push to pivot. I’m not one of those people that can tell themselves “just stop” and actually stop. So measuring bits of progress helps me.