Cold Turkey app has been a huge game changer for me on this front -
https://getcoldturkey.com/Have Reddit and Twitter perpetually blocked for the next 6 months. Hacker news only accessible on weekends.
It’s well worth getting the pro version for scheduled blocking as well. Plus it’s indie software so you get to support a the fantastic developer who built this!