The advice I hear given to aspiring writers is to just write. And, yeah, that's pretty important. If you don't do that one thing, you're kind of music the main component to being a writer.
But there's more. And the rest is... Harder. You've got to be able to market your work, too connect with people, to network and sell your stuff. You're still a writer if you don't do that stuff, but no one else knows it. And I assume you're asking the question because you want to get paid and you want people to know what you do.
So, research. That's my answer. Find a way to narrow down your question because that one is so big. I could write on it for days and all have an incomplete answer.