According to the book The Power of Habit by Charles Duhigg, all habits have 3 basic characteristics: a cue (or trigger), a reward and a routine. In this case, the cue is a notification from the app, the reward is the small dopamine rush you get by opening the app, which carries out as a routine of checking your phone every few hours.
To change any bad habit all you need to do is change the cue or the trigger, in this case, the notification. Whenever you get a notification, you get a little dopamine rush. Removing the notification, removes the reward and thus break the habit. You can either turn off notification for an individual app or use a simple notification manager app like Daywise on Android. This app blocks all the notifications and batched them together to be viewed during a pre-scheduled time. But at the same time, you can create exceptions for selective apps, so you don’t miss something important. Also, replacing addictive apps icons (like Instagram, Reddit, YouTube) on your homescreen with some boring apps, help make your phone less attractive. Also Read: Best Apps to Keep You Off Your Phone