The simplest thing you can do to stop yourself from getting distracted by the internet is simply disconnect your computer from it. You do not need to be logged on 24-7. This way, you won't be interrupted my new mail dings and new post bloops.
Use the internet and especially social media as a reward for doing X amount of work. For example, after you have finished writing 1,000 words, you will allow yourself 10 minutes of internet time. Set up a timer for yourself and stick to it. No cheating or you will have to use the next method.
3. Pen and Paper.
If the above tricks don't work for you, get old fashioned. Shut your computer down. Grab a pen and paper and begin writing. You can type it all in later or hire someone else to decipher your scribble and type it in for you.
4. Hire a Social Media Copywriter
If you feel that you need the social media as a means of marketing your books, hire someone else to do it for you so that you can focus on writing your books.
To be a writer, you need to have self-control and, while you are writing, you need to eliminate outside distractions. This means putting away your phone or turning it off (or just flush the damn thing down the toilet), reducing your internet distractions, and taking a sledgehammer to your television set. All those noisemakers are unnecessary to a happy life and they are huge time wasters. And time is something that is not on a writer's side to begin with.