I tend to use /etc/hosts to block sites on my desktop, like YouTube or HN. YouTube DNS itself is somehow special because it stays cached for new browser windows. So I further cripple it with ublock origin by disabling JavaScript.
I can undo these things easily enough, but it's sufficient that my monkey brain can't just open a tab and go there without my conscious permission ( which disturbingly is how habit forming these sites are for me.)
I keep them available on my mobile, but I have an old, slow phone and I never keep it on my desk, I put it out of reach and with notifications on silent.
For things like Facebook and Instagram my solution is simply to delete my account and never let that abomination steal precious minutes of my life. I don't miss them at all.