Research. Get involved in writers' communities/clubs/organizations and attend writers' conferences. Start building a network of writers who write in the genre you're trying to break in. That can be found from just going to Google. So much on the web these days. If you're really serious, I suggest you find a mentor who writes in the same genre.
If you've never written before, I suggest finding your own style of writing. Be true to your own style. But I do recommend for new writers to do an outline before writing. Not mandatory but, I think it gives direction and flow of your story, so that it can make sense and so your story won't be all over the place. And cause you to lose readers.
Self publishing and ebooks are cool, but explore all options of publishing. I think it's good to be educated on everything involving publishing your work. There's also mainstream publishing and small press publishing, too. There are pros and cons to each method of publishing. Like I said, all these things can be found with just searching on the internet.
As far as patterns in knowing what an audience wants: A good story is a good story. So when I say know your audience, know who you plan to market your book to. So that when you are published, you'll know who to target and have greater chances of selling your work. Example: If you decide to write Christian fiction, then you'll know you can reach out to black women who have book clubs or try to attend Christian events and conferences to sell your work.
If you're really serious, you can always hit up my inbox. Good luck!