Before doing a thing - particularly things I can easily lose myself in, like doom scrolling - I take a few moments and ask myself what I want out of that time, which naturally dovetails into how long I want to spend at it. Maybe it's ten minutes. Maybe it's three hours. Then I set a timer for that long, and when the timer goes off, (notionally) I halt, walk away from the thing for another few moments and re-evaluate. Maybe I go back. Maybe I don't. Maybe I go back after doing something else for a few minutes (say, loading a dishwasher).
One of the key bits it to not judge myself or my wants. If I want to binge Factorio for a day... like, alright. I'll do that, even if I know later-me won't like having done that. No judgment, no beating myself up about it.
Another key bit seems to be not not doing the thing. That's a hard fight. AFAICT it's one part awareness, one part wedging in some mental/emotional space to make choices inside the habit loop (stimulus -> response -> reward), and one part good old fashioned habit-loop interruption (AFAIK if you literally add breaths-worth of time to each step in the habit loop, it drastically diminishes the oomph of what's happening neurologically).
The magic seems to happen in two forms:
1. "Taking control of my time." - Even if I'm making the same choices, now, my experience is that I am making them, instead of "them" making me.
2. "Stopping before you're tired means you don't start the next thing exhausted". Previously I'd binge until I beyond exhausted my enjoyment of the thing. Now I have a way to do a thing while I'm enjoying it, and stop once I no longer am.
PS - I've also started wondering if this is whatever the hell people actually meant when they talked about "time management" when I was kid, but no-one actually ever explained.