Setting small, realistic goals and when you meet them, rewarding yourself. Something like 'I'll work for 45 minutes without checking social media and if I do that, then I'll spend 5 minutes or so looking at my phone'. Don't reward yourself with food!
If you really do have a problem with procrastinating using the internet, and you have control of the router, most of them allow you to change 'access controls' - try disabling your internet connexion for a period of time. This really helped me to stop googling and getting sucked into online stuff when I should have been working. Of course, if you need the internet for the work you're doing, this is going to be more difficult, but simply download or open tabs with the content you need and then disable the internet.