OP's post focuses on understanding, which is informative, but maybe not so helpful. Here's my drill.
Small steps. First cut smartphone access. Delete all, but essential apps(e.g. work-related) in your phone. You can still visit whatever you want on another device you don't carry around with you e.g. a laptop. Do that for a month or until you feel ok about it.
Start to do SOMETHING ELSE that is somewhat productive, a sport, fishing, etc. Make sure over time to up prioritize that activity and down prioritize social media. Rinse and repeat :-)