What works for me is removing the antecedent completely by charging my phone in another room at night.
Now the battle is easier: Decide once a day to put it there, and track how many days you succeed.
For me that's a lot easier than having it in my pocket, where the Internet is always a couple lazy taps away. Now I at least have to walk to it if I want it, and that often "breaks the spell."
I finish work and chores hours earlier when my phone is charging in another room, without consciously doing anything else differently.
It really makes me want a 1980s-style cellphone with no screen and big physical buttons.
Leaving my phone on the charger in the bedroom after 5pm completely removes the temptation. If somebody needs to reach me, they can call my wife or just leave a message for me to check in the morning. I've been doing this for several months and it's worked wonders for my attention span, my sleeping habits and my vision.