The best is the enemy of the good [1]. I constantly remind myself of that and I still fall for the trap. So I write down two questions, dubbed the procrastination questions:
1. What do you think you are supposed to do now? 2. What kind of difficulty are you facing?
And then it's easier to continue working.
[1]: often attributed to Voltaire