There’s some who say you should write only what you know about and others who say you can write anything you like. You can of course, write anything you like and if you want to write about a serial killer you don’t need to be one. You don’t even need to be a detective but you need to do plenty of research. The same applies for all writing–it might be fiction but if it’s obvious you have no idea what the laws are, what detectives do, it just won’t be convincing fiction. Readers like to imagine it could happen. And detectives are also people, so they have personalities and you can make your characters more lifelike if you, either intentionally or otherwise, use some aspects of people you know.
Even if you’re writing fantasy there needs to be some level of reality–something readers can relate to. Your characters might be green and have two heads but what are their personalities like? Whatever your protagonist is it’s important they have a character of some kind and their behaviour makes sense.
It’s also important to use language you’re comfortable with–I’m not talking about making up a new language for your characters–I’m talking about writing with everyday words. Write the whole first draft using words you’d use every day. Use it’s instead of it is in dialogue–contractions make dialogue sound more natural. Don’t put in words you think make you look like a better writer–they don’t. What they do is distract from the story and you don’t want that. You might want to use more stiff language for some characters of course.
Once you’ve finished your first draft and you realise you use a word such as awesome a lot, then you can change some but be absolutely certain you know what the substitute word means. Keep it simple.
I didn’t know, when I first starting writing, that I had my own style. I wrote with another author for a while–a well established author who just needed some help temporarily–and I probably tried to write like her. When I’d written a couple of my own I realised that even though I write a range of genres I do have a style, basically it’s KISS–Keep it Simple, Stupid.