There are some simple practical steps you can take: switch off as many automatic notifications as you can (the less your phone is pinging and vibrating in your pocket, the less inclined you’ll be to check it), and set yourself some boundaries, such as not taking your phone in the bedroom or having it to hand at mealtimes.
Banning yourself from checking your phone altogether is unlikely to work long-term. Instead, get more control by planning specified times when you’re allowed to indulge in some news browsing or social media bingeing.
At a deeper level, consider the psychological need(s) that your phone-checking is satisfying. As with beating any unwelcome habit, you’re more likely to succeed if you can replace the habit with a healthier alternative. For instance, if boredom is the issue, consider carrying an entertaining book or magazine that you can glance at instead.
Alternatively, perhaps you’re really craving more social interaction – if so, consider finding ways to increase your opportunities for more face-to-face contact, such as by joining a sports club or volunteering for charity.