I know what you're saying, it happened to me too.
In some way, checking facebook states, and updates took my time, and i couldn't get to study very well..
I think someone said it before, but what i started to do, was to put me a goal.
So, after i finished reading one chapter, or one subject, i'll take like an hour, or something like that to check facebook, youtube, see some tv show, and then i come back to studying.
This is all about habits. If you know that going to Facebook, or whatever, releases all the stress you have, when you study, and you feel overwhelmed, automatically you want to go to Internet to feel better.
It's a mind game, just think you'll feel relaxed after you finish your day studying, and don't enter into the internet, after you get your goal.
Make it a half of a chapter, then a whole chapter, and then u make it longer with the time, and i'm sure you'll be able to avoid the distractions.
👍 good luck