With other genres and types of writing you can usually sit down with a vague idea of what your plot will be and write something decent, but with mystery stories a plan is absolutely necessary. This is because in more than any other writing you as the author need to know every detail of your plot before you write it. The way a character is dressed, how busy the coffee shop is where your characters meet, if your crime happens on a national holiday (and which one) all need to be known before you start writing, because all these details should be somehow relevant to your mystery. Some details can be added as false leads, but even with these you still need to know where and when in your plot they will occur so you can give your mystery and its unfolding a solid structure.
Respecting your reader means that you regard for them as intelligent and thinking people which is reflected in your writing. To make this respect clear, avoid using any plot tricks that could be described by the Latin phrase deus ex machina, meaning an abrupt and sudden solution to a plot problem based on a previously unexplained character, ability or detail. Examples of deus ex machina tricks are last-minute revelations of an evil twin, the sudden use of psychic powers, or the unexplained introduction of a single mystery-solving clue. It is especially important to respect your reader when writing a mystery, because the mystery genre is an intellectual game like chess and using late, convenient revelations is like forcing your reader to play with too few pieces.
You and your reader may be rooting for the detective or hero of your mystery story, but a good hero needs a compelling and challenging villain. As a mystery writer you should write your villain as an intellectual match for your detective, and you should help him or her to cover his or her tracks right to your story's end. Consider all aspects of your culprit's motive, skills and opportunity to commit the crime to come up with ways to conceal your culprit's identity. If your culprit knew the victim, for example, and he or she denies this, then make sure that all of the clues pointing to this lie are carefully hidden by your villain.
Part of the fun of reading a mystery novel is trying to unravel the puzzle that is at its heart. Although this is the detective's job in your story, your reader will be doing the same thing as she reads and so you should give your reader all of the clues that the detective has and vice versa. Giving the reader and the detective just the right number of clues will also bring your reader into the mystery and help to create a need in him or her to solve it.
All the clues included in your mystery should, in some way, logically lead to your mystery's solution. Obviously, you do not want all of your clues to announce the culprit, but when your reader has completed your story he should be able to re-read it and clearly see how your clues lead to the culprit.