This is one of my favorite topics tbh. We spent a LOT of time thinking and talking about this in grad school (mostly because we all had to write a publishable book in two years).
For me, at least, writing is my job. Like, my actual 9-5 job involves a lot of writing, too. But being a capital W Writer is also my (currently unpaid) job. Thinking about it like that shifts it up the priority list and makes it easier for me to focus on. Which is, of course, a lot easier in theory than in practice.
I used to be super good about scheduling time for myself to write. Before I worked full time, every weekday I didn't work I wrote 9-5 with a break for lunch. At other times, when my schedule was more flexible, I wrote for two hours minimum every morning. Finishing school and starting a full time job threw me off for a while, but right now I mostly aim for 2-3 hours of writing every weekend day and I *try* to spend at least 30 minutes writing in the evenings during the week (that one is harder to accomplish). It REALLY helps me to set timers, like long word wars, to make myself focus exclusively on writing for just a short amount of time. I get the same amount of writing done as I would have if I was distracted, but then I have more time for other activities.
Goals really help. Right now my writing group (<3) is doing weekly "critique" swaps where we send someone in our group a chapter (like 2-4k on average) we wrote that week and give each other (generally positive) feedback. This has helped me get the work done, at least, even if it's all crammed in on the weekend, because I have someone holding me accountable for my goal.
Other times, I've used
Pacemaker to set adaptable wordcount goals (usually when I have a good idea of how many words a project will be; for example I used this a lot for the last few drafts of my thesis). You can set it to distribute more words for days you have more time, and give yourself off days, etc. If you go over your daily goal (or fail to hit a daily goal) it auto-adjusts to keep you on target to finish "on time". It's great for NaNo-ish goals that are more/less than 50k or need to happen over/under a month! Highly recommend.