Identify your targets. A query letter can be sent to editors, agents and publishing houses, so decide who you want to send the letter to and find the appropriate contact details.
Expand your research. Once you have found the names of some potential contacts, it's a good idea to obtain further details by checking the publication's website to gather as much information as possible.
Write out a shortlist. Using your research, cross off any that you no longer wish to target, and rank the others in terms of appropriateness.
Study the style guide. If you're contacting certain publications, particularly a newspaper or magazine, there will be specific editorial guidelines. Knowing this will help you sound more knowledgeable in the letter.
Find out who the editor is. This gives the letter a more personal feel, as you can specifically send it to the person in question.
Be specific. Describe in good detail what your article or book will include and, if necessary, what it won't include. Specify an intended length and mention why you feel the particular publication would be suitable for your writing.
Sell yourself. Tell the editor why you feel you are the best person available to write the article, and explain why you are qualified to write about the subject.
Make it interesting. There are numerous perspective writers out there, so you need to stand out from the crowd. Present your idea at the top of the letter and look to incorporate new and innovative angles.
Keep it concise. It's important to get enough information in there, but you should condense it into a snappy, readable letter of no more than one page.
Include appropriate writing samples. By including past work on a similar subject matter, you can backup the quality of your work.