@JaneEyreZH
Personally, I set aside writing times in my calendar. When someone asks if I can meet then, the answer is "no, I'm sorry. It's already booked."
I have also long ago found my own personal "efficiencies" - I write best in the morning, so I reserve those times for writing.
There are also a whole slew of "tricks" I learned from my creative writing background - including
(1) the vomit draft - always edit on paper (electronic paper is OK), just don't edit in your head.
(2) the "Hemingway point" - when you've written a lot for the day, stop in the middle of a sentence. That way, when you come back tomorrow, you can start writing by finishing that sentence.
(3) make it habit - don't just write when the spirit moves you
(4) rewrite by retyping / rewriting, not by moving paragraphs around, even if you are retyping the same text over
(5) make sure there is time to edit. After you've written something, put it aside for a week or a month and come back to it. (Write other stuff in the meantime see note 3.) Then rewrite [note 4] that month-old text.
Importantly, there is no one "right way" to write. Try stuff out. Your mileage will vary. Find your own personal efficiencies. And yes, your efficiencies will change as your life changes. Be prepared for that, and then go find the new efficiencies.
Oh, and (6) Don't forget to READ! Read all kinds of things - fiction, not; in-field, out; great literature, trashy literature; great science, great art. Sometimes people get so wrapped up in their own writing, particularly as other life-needs occur, they don't do enough reading.