So you do like you do when meditating: recognize that your attention has wondered, bring it back to the task in a neutral way without guilt or shame, and start over again like you never strayed, even while you know it will happen again and again despite your best intentions. This is how you write, one little block of time after another.
But that is ok, it is just how the mind works and you have to accept it. At least, it's how my mind works. I haven't meditated in years, but I did get better at focusing then and I have gotten better at focusing now while writing. I'm much better at catching my attention wondering at the beginning, instead of realizing 60 minutes later that I was way off track and stalled. I can't tell you what a relief that is - I was convinced for years that I couldn't write because I couldn't keep my focus on the screen long enough to actually write something. I've learned the hard way to catch myself wondering, and to learn how to keep the words flowing (often- but I'm still really working on this). Throwing up a [research this later!] type thing really helps me keep momentum - I think if I'd known about that years ago, and really understood that your first draft doesn't have to be perfect!, I'd have kept writing instead of convincing myself for years that I couldn't do it. Also, I have really learned the value of a good outline, and that I am an outliner to my core. Again, even though the outline was overstressed in school I somehow MISSED THAT FUCKING CLUE as to how to actually get stuff done.
Eh, what can you do? Life is about learning, there's just no other way to do it.
And now for some inspiration. I found this interesting Goodreads post: Keep Writing! Authors Share Their Best Advice on Overcoming Writer’s Block. I love these:
Writing is a job. Some days you don't feel like doing your job. But there is no "teacher's block" or "dentist's block." I can't figure out why we have created this mysterious phrase .. only for writers .. which only means "don't feel like doing this right now." - Lois Lowry
The trick is to identify what is holding you back, and address that issue separately. Usually, 90% of the time, it is fear — and usually (again 90% of the time) it is fear that your work isn't good enough. Whenever I encounter that fear, my response is: "Who cares?" I'm not in charge of whether or not my work is great, or how people will like it. I am only in charge of the process. I came here to be a writer, and so I write. Set your kitchen timer for 30 minutes a day, and write something. It doesn't have to be good. It doesn't even have to be finished. It just has to BE. - Elizabeth Gilbert
ARGH! There's no such thing. Seriously: THERE. IS. NO. SUCH. THING. You know what there is? There's a bunch of problems, creative and otherwise, that can stop you writing. They are not block. They are important skills. For example: very often, around the middle of a book, I grind to a halt. I can go no further, everything I write is catastrophically stupid. I tend to get very upset about that, and I'm unmentionably annoying to be around for a few days. My wife generally has to remind me how to fix the problem.
The way you fix it is you go back to the beginning and you get rid of all the junk, broken stuff you put in back before you understood what the hell the book was actually about, the stuff that is now preventing you from doing the really amazing things that will make the book special. You have to re-envision the whole thing, understand what you meant but could not at the time express. Sometimes that means cutting heavily, sometimes it means changing great swathes, sometimes it's a question of reading that crucial passage that carries your book in potential and taping it up over your desk.
Calling that moment "writer's block" is slandering yourself. It's not a block, it's the process. Don't demonise it! Beg for it! It's what stops you from writing lousy prose, saggy plots, unsatisfying endings. LOVE YOUR CRITICAL FACULTY.
Alternatively: at any time in the course of a book, I may find I cannot write it, bash away at it, hate myself, and then realise it's because I haven't done my chores. I haven't paid the credit card bill or whatever.
Understand: your ability to write is bound up with who you are and with your moods. It is tied to whether you are happy, sad, tense, relaxed, blah. It is you. So when something is wrong with your inkflow, that means either that you've goofed creatively or that you're not fixing something broken elsewhere in your world.
Love your mutant power. Do not try to force it to do something. Learn to listen. - Nick Harkaway
And now I have to get off the internet for the night :)