The best way to write a good detective story is to work backward from the crime
The writer should first decide what the crime is and who the perpetrator is, and then come up with the circumstances and clues based on those decisions
To make a great tennis shot, you should visualize where you want the shot to go. Then you can determine the position you need to be in to execute the shot properly.