Query letters help you target appropriate markets at a minimal cost. There are numerous articles and books devoted to query writing. Occasionally you can find a workshop devoted to to this important aspect of writing. Writers Digest, http://www.writersdigest.com/GeneralMenu/, and Writing World, http://www.writing-world.com/freelance/index.shtml, are two excellent sources of query articles.
In a query, you are asking the editor if she would like to see your finished piece. You can send out several queries at the same time, thus you don't waste time writing an article for which there is no market. Practice writing your query letter until it will do what you want it to do - get the attention of the editor and get you an assignment. Query letters do not work for fiction - unless you are marketing a novel.
Remember a query letter is oftentimes the first time an editor will meet you. Consider it a job interview and present yourself in a competent, professional manner. Avoid unusual fonts, make sure your grammar is perfect, and convince the editor you are the right person for the job.