Devise your mystery. Mystery stories are usually about a murder, but a mystery can also be about a search for a person or an object. Whatever the mystery is in your story, make sure you know what it is and how it will be solved.
Create a great sleuth. Great sleuths don't have to be law enforcement officials. Nancy Drew and the Hardy Boys were always involved in mysteries, but they weren't police officials. Even Tom Sawyer once played detective.
Plant clues fairly. You don't want to plant clues that are so obvious that there isn't a challenge for your readers, but you do have to play fair with your readers. Do not, under any circumstance, have your sleuth solve the mystery by using information that was not somehow available to the readers.
Plant red herrings, but use them sparingly. A red herring is a false clue that temporarily leads your investigator--and your readers--in the wrong direction.
Give your story a strong ending. Try to surprise your readers by giving them the unexpected--provided you've played fair with them. Have your sleuth explain how he solved the mystery, but make this scene natural and fun, with creative use of dialogue, so your sleuth isn't spending the last few pages lecturing the other characters--and your readers.