This is one of the major things when you are working on anything. Because we start doing a task and then we get distracted. We get distracted by opening up twitter or some other social network. Then we end up doing a thing that is not even related to what we initially planned to do.
Whenever you focus your efforts on a task and avoid distractions amazing things will happen. Day after day whenever you are completely focused you will start to see progress. For example now as I write this I am hesitant to pick up my phone and check instagram. We all go through these symptoms.
But you you have to be honest with yourself and really focus on what matters. Do you day after day say to yourself I should do this and I should do that. So therefore get rid of the useless distractions and think about how much they are benefitting you and if they are helping you to become better.