If you figure out a way to solve this problem, please let me know - as someone who works from home, internet distractions are the biggest thing that stand between me and success.
I've heard the advice for writers of "turn of your wifi and just write without distractions". But, coding requires the internet in most cases. Hacker News is simultaneously enriching and distracting for me. Youtube is the source of all knowledge, both useful and incredibly banal.
I started using hnwatcher.com to notify me when certain topics I care about come up on Hacker News and that was a big level up in being more smart about time spent on here.
Reddit I have no idea how to use. I have the feeling I should just permaban it from my life, but it does have it's uses. Same with Twitter. Youtube has probably sucked more of my life away than anything else watching dumb videos that aren't useful or even entertaining/relaxing. It's one thing to do something to relax, but some of my internet surfing seems to fall into this weird middle ground of neither productive or fun, just addicting.
Perhaps one option is, as someone else mentioned, more curation. I don't usually have to worry about reading the news even though I do, since I know I'll get word of important things from my friends who do read the news a lot.
I recently joined a private freelancer community online, and that has replaced a lot of what I used Reddit effectively for - finding new ideas and rubbing shoulders with peers.
I'm also a fan these days of mailing lists since they are not sources of infinite content like Youtube/Reddit.