Two things:
1) Figure out your MBTI type, and research it. I found that my own type (INTP) really described my work pattern quite well. I found it a bit liberating, as I can try to plan towards my strengths a bit.
2) Exercise can really help here. If you're procrastinating, you're not doing useful work. So work out instead. The exercise can help your motivation and focus substantially. Much more than coffee or red bull.