So this is part of's project to teach how to write fan fiction. The following is my advice on how to write a mystery. Feel free to ask for questions and elaboration
So, the main, and best thing you can do when writing a mystery is plan it out first.
I'm dead serious.
Every. Single. Detail.
Plot every move in the mystery, that way during the grand revelation you already know all the clues that are in place. However, don't feel limited by what you have plotted. Feel free to change it up. Just get down the basic idea of having all the clues laid out. However DO NOT FORGET TO PUT THE KILLER OR WHOEVER IS COMMITTING THE CRIME INTO THE STORY. For example, I ran into this problem when I wrote my first mystery, and I didn't want to suddenly have my characters say "you know that guy I never mentioned until now? Yeah, he did it."
If you can't fit him in, throw in a small cameo. Maybe the guy bumps into him for a split second and later realizes who he is. Maybe (like I do a lot) have the character at the crime scene before the murder was officially announced. Make them trip up, but do it subtlety.
Another thing for mysteries is if you're having a killer or what have you, give him a proper motive. It's boring to read stuff like "Oh he did it cause he's insane." or "He'll never talk about why he did it" GIVE THE GUY A REASON TO DO WHAT HE DOES! Whether he does it for Vendetta, he's being blackmailed or what have you. GIVE YOUR VILLAIN A PROPER MOTIVE!
In summary: Plan ahead so all the pieces are there, and make sure you have introduced the character before you solve the mystery, and just for clarification, make the clues make sense. Not one of those way out there mysteries that nobody would have guessed in their right minds. Make it something the reader could guess if they went back to look at it.
I'd like to end on this note: NEVER make the Butler do it. Way to obvious.
And there you have it. How to write a mystery by primepower53