Choose the exact time period and location for your story. A few tidbits of information from research helps you establish a rich picture of the town and year in which your tale takes place. It may be fun to set the story in your hometown so that you have easy access to archival records from the 1930s.
Decide on a crime. For many people who write a detective story, this may be the first idea they come up with. The crime can be a big one such as murder or simply a local incident that affects the town in some way. Outline the crime in a time line to show when things happened in sequence. The time line also can serve as a helpful guide when you need to determine clues.
Develop the detective by listing his name, age, gender, nationality and any other information you can think of. G.K. Chesterton, a well-known commenter on detective stories, believed that the ideal detective story involved a crime that fit the detective in some way. Whether a womanizer helps a mother find her child or a booze-hound helps to uphold prohibition, you can create palpable dramatic tension by pitting the two against each other.
Use your time line and your knowledge of the detective to sprinkle clues throughout the story. Make these clues interesting and not too complicated. This way the reader will be able to follow along without getting confused.
Create a series of characters who are potential suspects for the crime. All of these characters should be completely three-dimensional and have reasons both for committing the crime and for not committing the crime. Chesterton thought that the ideal detective story lets the reader enjoyably feel like a fool when the criminal is revealed. The revealed criminal should elicit a feeling of "I should have known it was him or her!" from the reader as opposed to a feeling of "Well, that was obvious."
Give each of these suspects an alibi for the crime and a motive, a method and an opportunity to commit the crime, and feel free to make each of them extremely convincing.
Write the climax of the story as a big, tension-filled event that may put the detective hero in grave danger and that somehow reveals the secrets of the mysterious crime.
Resolve the mystery with what is called the denouement, when all the secrets are revealed and the loose ends are tied up.
End the story with a satisfying conclusion in which we see the lives of the detective, victims and suspects go back to normal or change after the resolution of the mystery. You can leave the beginning of a new case at the end as a sort of cliffhanger until the next appearance of the hero.