You will hate the following at first because your hormones will be out of wack, but once you do it for a bit you will be much much happier. Also, this comment will work best if you aren't working during this time, but if you need to for financial reasons, adapt and follow the advice anyways (for example: only use the internet for work, the rec league meets evenings. And only work 40 hours.)

1. Get off your computer. Take a break, go outside. Literally. Take a walk. It will increase your attention span and help you in numerous other ways.[1]

2. Get off the Internet. Completely. It is incredibly hard, but it is necessary. The Internet is the place that will only cause you stress during this part of your life. To quote a 2011 article from psychology today[2]:
> A growing body of evidence shows that video games and other electronics induce the fight-or-flight syndrome, putting the body in a state of stress. Studies show sustained increases in blood pressure and pulse, even hours after playing a video game. It doesn't have to be a violent game, or even an action game-or even a game at all! Over time, internet surfing and texting will similarly put the brain and body in a state of stress, just from the high level of visual and cognitive stimulation.

3. Learn to pay attention. Start each day by telling yourself you'll do something productive. My suggestion is to read a book, clean up, or any _hands on_ hobby but the important part is - it will be hard - to focus. If you feel yourself getting distracted and wanting to check HN or Reddit or anything else that isn't what you are doing, break it up with something physical. Cleaning up? Do a jumping jack when you want to check reddit. Now go back to cleaning. Reading a book? Stand up for 10 seconds. Then go back to reading. Attention is a survival skill, and once it is mastered it will bring much more happiness than Hacker News. You will actually accomplish things.

4. Pick a sport or something you like to do, and find people in your area who like to do it too. Join a casual ultimate frisbee league, or some other sport of yours. Talk to people. It will be hard just like everything else, because the internet has given you a lack of social skills. But you have to, because otherwise it becomes a self fulfilling prophecy and you'll just communicate even less in person. Once you learn what real in person interaction feels like again, you'll like it way more than the internet too.

5. After you've done the last 4 for a while (a couple months) and you've began to feel the positive effects, then you should begin using the internet and social media in moderation again.

Humans didn't evolve to receive information at the quick pace computers give it to us, and the long hours you work, in addition to the lack of in person interaction you mention, has created the brain fog you experience. Luckily, the brain has also evolved to change itself. (Did you know brain cells are the fastest replicating cells in the body? It's why brain cancer is the most deadly of them all.) A clean break from all this, then a gradual reintegration is the way.

Edit: I will also second the person who said to study philosophy.

1:
https://www.psychologytoday.com/us/blog/mental-wealth/201306...

2: https://www.psychologytoday.com/us/blog/mental-wealth/201103...