Set out time to write regardless of how you feel that day. It doesn't matter if it's good or not. Sit down and type. Refuse to bargain with your subconscious that says "I'm dry. Let's try tomorrow".
It's hard to feel "it is a good time to write" all the time. I am often terrified by the blank page I'm going to work on or feel dry and have no inspiration to write. This makes me procrastinate on writing since I find an excuse and just want to find a better time with enough motivation and momentum.
Seth Godin at David Perell's podcast talked about how Isaac Asimov taught him how to write. Seth asked Isaac, "how do you end up with 400 books". Issac said:
"Every morning I get up and at 6.30, I sit down at this typewriter and I type until noon. And it doesn't matter if it's good or not. I just got to keep typing."
Seth learned that "Well, if you're going to type anyway, you might as well type something good." And so something good came up. But he refused to bargain with the self-conscious ever and say, "Oh, I'm dry. I'm getting up." Nope. Just Type.
This also resonates with me with another quote I learned recently by Amos Oz:
"[For writing] I think of myself as a shopkeeper: It is my job to open up in the morning, sit, and wait for customers. If I get some, it is a blessed morning, if not, well, I'm still doing my job."