I've read several contradictory blog posts in the last couple of years about whether a writer should write to an audience or not. Some blogs will tell you to write for yourself, while others will tell you that's unlikely to sell your work. Here's my take on it.
In a lot of critiques I've participated in, the writer has been criticized for making the protagonist too general, too bland, not fleshed out enough. This happened especially with the creative writing classes I took. These young writers were trying so hard for universal appeal that they wound up alienating all of their potential readers.
This is where that old piece of advice, to "write what you know" comes in. As I outline in the post, that's not permission to not do your research, or to write all your stories about the same, exact people doing the same, exact things. Rather, it's about emotional verity. Add in bits and pieces of things you've actually experienced, people you've actually met, places you've actually been. Even if you're writing an epic fantasy about a medieval land that never did and never will exist, you can add details from history, or from some of the places you've visited where people aren't glued to a computer screen all day. And even if you're writing a character who's your exact opposite, give that character emotions you can understand and relate to.
Especially in an early draft, one of the quickest way to paralyze yourself is to think about who you're appealing to with what you're writing. You're not going to please all readers all of the time, and you'll burn yourself out trying. It does help to figure out who you're writing for when you're editing for submission, and then your editors will help you hone your story better for the market they want to sell it to, but early drafts can and should appeal to you. If you're not enjoying the writing part, who'll like reading it?
When I write, I'm not thinking about making what I'm writing appealing. I'm thinking only of what the characters will choose to do, what the antagonist will do to stop them. I like to read interesting books with fleshed-out characters and a touch of humor, so that's what I try to write, because I can't imagine that many readers don't want the same thing out of the books they read.