By turning off your notifications, you can avoid being enticed to open social media.
Distract yourself by doing other things, such as exercise, reading, catching up with friends, etc.
Your phone's screen time tracking feature can be used to block specific apps after a predetermined amount of time.