Stay with the moment.
Don't get up from wherever you're writing. Don't use the bathroom unless you really have to. Don't go for that cup of coffee. Don't think about anything other than your writing. Stay with it, ride it out for at least twenty minutes. And you'll find that those twenty minutes were some of the most fruitful writing you've produced. It's such a simple thing to do, but it's also easy, so easy, to think "I'll just be a moment" while you get that coffee, check your email or what not.
Stay with it, just a little longer. You'll be glad you did.
As a side note, something that assists with this endeavor is careful planning. Having that cup of coffee handy, having your music playlist already arranged or checking your email before you start (but not responding, you don't want to put off writing in favor of email,) will make it easier to stay in the moment.
Now where's my coffee...