In my work as a designer, and now as a founder-coder, I have the luxury that most people working miss: hours of meeting-free, uninterrupted time to get things done. I think anyone who managed to build a career in this working model has proven to be able to stay focussed and disciplined, when there is no boss around who can remind you that watching Netflix episodes during work hours is not what you are supposed to do.
Still, my work is not an endurance test to resist temptations. I tend to group my work into different types and switch between them when I am stuck, bored, tired, energetic, full of inspiration, suffering from the downstairs neighbour who is drilling in the ceiling.:
Cracking a complicated problem (fundamental code architecture, the visual approach to a new presentation)
Just making something look pretty (user interface, that competitor slide)
Googling for solutions for that nasty, but actually unimportant, bug
Writing a week full of blog posts in one go
In my time as a consultant when I was working with lots of people, I could not really set my own working schedule. Now that that noise has disappeared you start noticing there are huge differences when you do certain things during the day, and in what mood.