I had the same problem. If I go online my brain just gets fried.
I came up with some solutions for that.
Tldr just turn the router (and my phone) off before bed, and keep it off for at least an hour in the morning. I tend to get more real work done during that time than the rest of the day combined. So I usually keep it off for a few hours extra, because getting stuff done feels good.
> Getting sidetracked by absolute nonsense -- roughly 100% of which comes in thru the internet. The “actual problem” is “task switching”, of course (alt-tabbing), but I found this impulse miraculously dissolved when I unplugged the wifi router... and removed my phone. Can’t be tempted by what ain’t there!