I dedicate a few days a month to being absolutely phone-free. The key point is I'm allowed to use Reddit/IG but I have to use a laptop/desktop to access them. This method requires a key ingredient: three ziploc bags.
I wrap both my work phone (when not oncall) and my personal phone in three nested ziploc bags and put them in a drawer. This acts as a great deterrent most of the time.
I've started doing this on/off since last December. Each month I aim to have at least like 6+ completely phone free days. This isn't to say I still don't have bad days where I'm completely addicted to my phone, but overall I feel so much better with this habit.
My therapist who deals with other software engineers has mentioned me as a positive case study for people with similar problems :)