The problem is big and difficult to resolve, even more because they want you to be this way. You at this point must have a smartphone with internet and at that point you are screwed, or you go to it by your own will every now and then (10 minutes XD) and most likely got trapped for more time or it calls you directly (mails and notifications, everything that make your phone ring).
Also the "likes", and everything close to that aka small useless things that make you feel appreciated, are just like the sense of satisfaction you get when plying and acheving something in videogames, it works by making you produce dopamine just like a drug or anything that makes you feel good like sex, achievements in your work or life, good food etc and they are meant to be that way and produce this effect in your mind (it works more for male than females anyway).
Another possible solution, even more important if you are studying for something or need to study for something, but it is usefull in general, is to make a time schedule in order to reach something, I used to go to my local library for a set of 3 or 4 h daily when i was under exams (yet smartphones didn't even existed back then and that library had, has, an awful internet connection).
Another possible way, which needs dedication and honesty (I have tried it a few times but it lasts just few days..), is to write down every evening what you have done that day so that you realize what you have done or not done that day (in my case if I had respected my time targets). It is painfull to write it down and realize you have done nothing usefull that day but it also makes you realize that you must improve and do better tomorrow.