I don't. These days I try to be online only to do something specific: searching for specific, writing, email etc. I am online for 2/3 hours/day. I use Facebook Twitter etc. but not that much. Here's a trick: turn notifications off on all your devices and you'll be happier. The idea is to "consume" only the content you want and only at the time you want.
HN is one of the places online that is NOT a wast of time. It is full of useful informations.
After using internet since mid 90's, and being one of first people that got the first gen iPhone, now days I try to NOT use smart phone or internet unless I need to.
This is has significantly improved my life quality. Having more fun, I focus on the people around me and the 3d reality more. Then when I was using a lot of smart phone. Of course that is not the only thing, I had to do however it is a VERY good starting point. Highly recommend everyone who owns smart phone to try using it only in airplane mode.
Browse on mobile-web. Facebook unfortunately is still important to maintain real world connections. Once you stop letting Facebook monitor your usage, the feed is not as tempting either.
Try Daywise. It was developed in collaboration with Duke University, and I've at least in my anecdata found that most notifications even if relevant, can be addressed when sent in batches every X hours. Also has reduced my spending on "deals" online.
Mindlessly reading news or watching videos you would get dopamine, while making effort for studying, exercising and programming can give you endorphins
Endorphins can make you calm and feeling peaceful and truly satisifed, it is meant for long term while dopamine is for short term gratification
I'm unsure whether the English definition of these two hormones are correct or not, but in my native language, it is as how I describe above