Drink beer. :)
I do the "ugly parts" first... the heavy lifting part. Then work on the content, eye candy, and fun stuff. How to get it done? What works for one may not work for another. For me it is "need" as in I need to pay this bill, buy this food, etc.
Focusing is different for each of us. How to get out of it is simple: make the decision and have discipline. Easier said than done, of course!