Habit. If you want to be a writer, you first have to write. You can sit down and free write. You can write first and edit later (or “write drunk, edit sober” as the saying goes). You can use a timer and write for 50 minutes every morning or you can plan to write 500 words before going to bed. If it works for you, that’s what matters. (Here’s my habit.)
In a world where everyone is busy and all of us have a million opportunities to do something else, one way or another you’ve got to find a way to make writing a habit.
Focus. This doesn’t mean “only write about one specific topic” as some people say. If you want to be the world’s leading expert on marsupials in Macedonia, go right ahead. You’ll be a hero to all five people interested in that.
Assuming you want something more, it’s fine to mix it up and write about a lot of things. What you need is something that ties them together. That’s where focus comes in, possibly in the form of an overall theme or mission.
You need to be able to think: “I’m writing this because [x].” The x is your core reason. Having a good answer for that, and continuing to think on it, will bring you the focus you need.
Persistence. You’ve just got to do it! And you’ve got to keep doing it. Over and over. When you find yourself not writing, you have to find your way back. Continuing to work on something for a long period of time is often a strong predictor of success (except when it’s not).
By the way, all three of these are important. But if I had to choose one, I’d choose #1.