How to Write a Query Letter
Don't send a query letter until after your fiction book is complete and thoroughly edited, unless you are a published writer, or it is really unusual. If it is a nonfiction book, but not a memoir or other narrative nonfiction, you should write a book proposal instead.
Write in business letter style, one to two pages, giving title, word count, one to two sentence description including category, publishing history if any, relevant personal history, and a one to three paragraph summary of the work including the ending.
Some agents and editors are more interested in seeing the right "teaser" for the book than a complete summary, at least at first. All of us want to know if there is something special about you that sets you apart from the pack, such as writing or other relevant awards won or whether you already have a built-in audience for the book. Marketing is a vital element in today's publishing world.
Make sure you are querying the right agency for your book. Read the guidelines for submissions first. Some agents will only accept query letters. It always helps to personalize the letter to the agency. Tell them why you chose them to query, and why you want to be represented by them. Make absolutely sure you spell their name right!
Be sure to tell the agent if you are querying more than one agency at a time. Some agencies will only look at queries that are exclusive (sent only to them). And at the very least, it is polite to let the agent know if it is a multiple submission. But don't tie your submission up for a long period of time. Mention in the query letter the amount of time the submission will be exclusive (e.g., four weeks). Then at the end of those four weeks, if they haven't asked for more material or signed you up, start submitting queries again.
If you are lucky to have an agent sign you up, please do the other agents the courtesy of sending them a quick note that your submission is now withdrawn, because you have signed up with another agent.