I don't mean "wasting" like relaxing and maybe sorting out a problem in my subconscious. I mean wasting.
I seem to be doing better recently. What I do is focus on doing something. Whatever I will do right now that is remotely productive, that's what I do. It might be refactoring code, or drafting a proposal, or reading a book, or doing push ups, or using the debugger to explore something I need to understand, or playing with some new tech I enjoy learning. Pick up any tiny task and just do it.
It ends up mixing personal and work stuff, which is not great. But at least, at the end of the day, I did something. And slowly I will try to control my focus better to get particular things done.