Instead of immediately jumping to HN or "yet another youtube conference video for some language I'm only tangentially curious about", I use a browser extension (Leechblock) to give myself a lot of time (an hour) at the end of the day.
This trick works in two ways
1. when I feel that urge during the workday, my emotional brain thinks "oh boy! a whole hour of this at the end of the day! I can totally wait because it will be an hour!" 2. when that hour comes, I find I only browse around for maybe 10 minutes before I get bored.
ymmv but after trying to go "cold turkey" for the longest time, this was the best solution I could figure out. I genuinely like the info on HN / certain parts of youtube, but having them as some emotional relief mechanism that I would get a "hit" from myriad times each day was the unhealthy part.