I know that this can sound counterintuitive, but the best strategy to keep the phone away from me is to be on my desktop computer.
Different from when I'm on my smartphone, I do not feel any anxiety to check social networks using my computer. So I can focus more on learning some stuff, coding, organizing my personal data, checking my appointments, checking the tech news, or even playing some games (to have some fun).
This is what I've been doing lately too. I've taken all apps off my phone that I spent significant amounts of time on. My phone is now something I use for a few minutes, and then stop using, with the exception of navigational apps and music. My goal was to return to pre-smartphone days where having a laptop or a desktop computer puts just enough friction in so that I don't habitually whip out my device and start scrolling or surfing when I feel bored.
Another part of this for me is not going to sites that have infinite scroll. This means that even on my laptop, I will not go to sites where I cannot finish consuming whatever content was there.
For sites like HN where there is a rotating front page, I have an RSS feed of the front page that refreshes infrequently so I can sample what was there without always needing to return to the front page to look for new content. Currently I have this set to 1 hour. This has been a decent mix between missing interesting content and having a feed that shows me way more articles than I can consume. My RSS reader is self-hosted at home, which means when I leave the house I am not tempted to use my phone to read that RSS content.
Different from when I'm on my smartphone, I do not feel any anxiety to check social networks using my computer. So I can focus more on learning some stuff, coding, organizing my personal data, checking my appointments, checking the tech news, or even playing some games (to have some fun).