I am fortunate enough to work for myself from home, so I can make my own schedule and hours. I've spent almost two years working as a professional ghostwriter, and that has allowed me to perfect focus and discipline when it comes to writing. As a result, I write anywhere between 2,000 and 6,000 words on my novels most days. Slower days are usually because I am focusing on world-building, character creation, and other notetaking aspects of novel writing.
I'm more creative at night, hitting my stride between 10pm and 3am, so I've been trying something new where I split my sleeping schedule into two 3 hour blocks (I only need about 6 hours of sleep a night, thankfully). That way I have my writing time when I am most creative, but staying up that late doesn't interfere with the rest of my schedule. Establishing that is a bit of a work in progress, but, when I get it right, my writing is even more prolific.
I managed to write a 173k word novel in less than 3 months, a 70k word novel in less than 2 months, and 3 parts of a 4 part project, each about 160k words in length, and over 100k words in the fourth part of that project in less than a year. This was all accomplished between November 2019 and November 2020. Maybe I'm a little crazy, and there are definitely times where I'm not as prolific, but these projects have also been the first I've worked on since I became so serious about my own writing being a possible career option. I haven't done much revising yet, letting my projects sit for a little bit before returning to them, but that will come once I wrap up the current first draft I am working on in the next day or so.
As for a routine when I am getting ready to write, I always make myself some warm tea, usually a pot so I can enjoy multiple cups while getting in the groove. I always make sure I have at least two hours of time to commit to writing because it takes me about 45 minutes to really get in the rhythm. I'll put on some music but avoid television or movies. I'll review any recent changes or developments to my notes and I will reread the last few paragraphs I wrote before diving into the next section of writing. Even though I do my writing on a laptop, I still keep a pen and notebook handy for any scribbles or doodles I want to get down. I don't usually set a word limit/expectation for myself, otherwise, I find myself glancing at the word count and the clock too much, but I do set a specific time for when I will end my writing unless I am having a total lazy, responsibility free day, then I will just write.