It is a bit of a 'mare to get your noggin around at first.
Simple version?
Hello superdooper agent
I would like you to sell my 3,000,000 word fantasy book, The Bumper Book of Awesome, for a million pounds. (Optional extra - say why you are querying this particular agent - because they rep Super Dooper Awesome Author whose work is similar to yours etc)
Couple of paras (approx 200 ish words normally) about Why Your Book is Awesome. Make it enticing, really
show the characters and world,
and what's at stake for them. Specifics will sell your story so try to be specific and not generic (An evil power comes to the land - generic. A Super Turnip of Doom threatens to explode is he is not given 365 fresh virgins is specific) Don't forget to tell the agent
what actually happens in the book, or at least most of it (you'd be surprised how many people forget that bit....). I tend to go up to the Black Moment before the climax, and the Choice of Doom. Remember you know your book - the agent does not, and cannot guess.
A paragraph about where your book fits in the market (An erotic turnip fantasy with twist, this should appeal to readers of X, Y and Z - being books similar to yours), and whether it is a stand alone or has series potential (or both) Any writing credits.If you have relevant experience in book's subject (you are writing about brain surgery and you are a brain surgeon)
Cheers matey, let me know when I get the cheque.
Okay, kinda like that
Simple in theory
Hellishly hard in practice - it's the 'enticing synop' that gets me every time. But it gets easier with practice. Go and look at places where people show their queries for feedback. Read them, a LOT of them. Learn to pity agents.
Would you want to buy the book? Why? Why not? Apply to your own query. It's a skill like writing a book, and you need to study as you would study writing a book.