Once I started blocking sites from myself I realized I was reflexively jumping over to distraction sites, particularly when I felt stuck or discouraged. Don't fall into the trap of thinking that willpower is the only way to get more focused. Use software to level the playing field.
Another thing that's helped: placing my phone on the other side of the room to charge at night. I also have a strict no using tech while in bed rule. Waking up and checking Instagram/Twitter/News on a phone is a terrible way to start the day.