I'm not ashamed to admit that I use SelfControl [1] when I really need it. That way I literally can't access social media, HN, etc.
Ironically, that's why I'm on HN now. I know I only have 15 minutes and then I won't get to use it for another few hours. :)
[1]https://addons.mozilla.org/En-US/firefox/addon/leechblock/
[2]https://chrome.google.com/webstore/detail/stayfocusd/laankej...