A method that works well for me is to write three tasks on my window (with erasable marker). One task is in one color (I use red), this is the mandatory task. I have to get this task done. The other two tasks are written in another color (I use blue). These are tasks that I have to get done as well, but they are a bit more flexible. If something comes up, or I want to work on a different thing, I can. As long as I get the red task finished.
I usually find that writing these tasks makes me very focused, and I finish all three of the tasks and much more. I talk about it more below.
Let me know what works for you.