I have the same issue. I’ve installed a browser extension that allows me to set redirects for any url. I’ve setup Facebook to go to khanacademy.org (I’m trying to learn more about linear algebra/calc) and reddit to go to wikiroulette.co
So far it’s been working to stop my sub-awareness level typing of these URLs and wasting time.
Another approach would be to look into mindfulness so that you become more aware of your actions/habits.
As an aside, if interested in the topic of awareness/attention, I was just listening to a great podcast that’s sort of related to your question:
https://smartdrugsmarts.com/episodes/episode-123-consciousne...