"All of humanity's problems stem from man's inability to sit quietly in a room alone"
...but maybe that better sums up OP's issue rather than a solution.
Either way you'll need to take steps to make it harder to do the things you're currently doing (e.g. get a dumb phone, set up a firewall rule to block these sites, set a timer) but there might be a deeper underlying issue of having nothing better to do.
Perhaps making other aspects of your life more difficult will eat up this idle time while also providing more fulfillment. I've personally found that riding a bike to get food at some place farther away (as opposed to eating at home, ordering food, or just driving somewhere) is an excellent way to detach digitally, get some exercise, and force yourself to see new parts of your town/city. Obviously this doesn't work for everyone but the gist of this is to force yourself to take time to do something unexpected and difficult and find your reward in that instead of reading every HN thread, checking every email, and responding to all the memes your friends send.