There are two places to lose focus. One: yourself sitting down to do the work. Two: inside the work as the work itself loses focus. I’ll tackle number one, as I think that was what was being asked.
Caveat: I believe most writing advice is only as valuable to someone as it works. In other words, I believe all writing advice is a hack to get you to a finished draft and help you find tricks to get there. You try something. If it works, it goes in your toolbox. If it doesn’t, you mark it as not currently effective and move on.
Some ways to find more focus while in the act of actual writing:
1) Create a structured time that you always write in. We are creatures of habit. Repeat the same time and see what happens.
2) Write when you feel like it and are not pressuring yourself to come up with something.
3) Build a space that is dedicated to writing and where you only write.
4) Go write somewhere new and see if the old space you were writing in has become stale and is becoming associated with negative results. Like a coffeeshop!
5) Write in a new media (switch to paper, use a notebook, get a different laptop just for writing, use a new pen, try narrating)
6) Write in a new style (only write dialogue, skip dialogue and write action, only write narrative exposition)
7) Switch your POV to make it more exciting (you can change it back when revising)
8) Set word count goals that break the project down into smaller chunks to make it seem more manageable, focus only on hitting those
9) Don’t set word count goals, just write whatever you can write on the project
10) Set purposefully small word count goals that are easy for you to hit so that you feel accomplished and keep on writing past them
11) Don’t tell anyone about what you’re writing about before sitting down to do it
12) Tell someone how cool what you’re writing about is right before sitting down to do it
13) Change the tense of your verbs to make it seem more exciting (you can change it later in revision)
14) Write only the bits that seem cool and fun
15) Force yourself to write everything in order, give yourself permission to write crap. Revision can fix it!
16) Listen to music!
17) Sit in dead silence!
18) Make your font larger, it seems like you’re writing faster or change the font
19) Format the manuscript so it looks exactly like a book
20) Light a candle every time before you start writing to create a prewriting ritual
21) Don’t do that ritual crap, just start
22) Go for a run or walk
23) Write with a friend writing nearby
24) Write alone
25) Write really late at night so no one bothers you
26) Write really early so no one bothers you
27) Have a detailed outline for what I’m going to write and accomplish that day
28) Jump in and discover what I’m going to write as I do it
I have used well over half of all these at any given time to help myself, at times using different strategies on different projects back to back.
In general, I find that focus for me comes from having a detailed plan of action, a repeatable time of day, and a small ritual (usually music and noise-canceling headphones) before beginning with realistically achievable daily goals broken out of a rational break down of the larger project into easily achievable small bite sized lumps that I can tackle. For example, one page in the morning of a novel and one page in the evening being drafted.
And yet, I’ve found immensely productive writing sessions coming out of a noisy passenger seat of a car with the family on the way to an event while I was under a tight deadline and convinced I was writing the worst but was just pushing on.
Creativity is messy stuff. I’ve read some very good books about the nature of work as it pertains to creativity. There are certainly strong signs in research that over-expectations and too much time can hurt the quality of a project and that a sense of play and discovery is important. It turns out exercise (like daily walks) before creative work have a big boost. There needs to be a careful balance between trying to tackle too much and flaming out. However I tend to believe the best way to discover yourself is to try different things and log the results and see what happens.
As a result of over 10 years of logging my daily word counts and examining how I work best (clear schedule, clearly defined goals, walks for exercise, writing first before all other items of the day) I’ve figured out my best practices. I don’t always follow them, but I know what has to be done when push comes to shove to nail that certain deadline…