So how do you do it? What makes a query stand out?
The first step is knowing who you're sending it to. Do your research. Be sure that the agent or editor you're submitting to would be remotely interested in your work. In other words, do not send erotica to an editor who publishes science fiction. The more you do your research and narrow down your choices, the better your chances of getting a partial or full request on your manuscript.
Second step, is to be sure you've understood the submission guidelines. They're all different. If that agent/editor requests the first ten pages along with that query, make sure you send it! If they don't request anything, do not send anything. Do not send bribes, head shots of yourself in your best literary pose, or gimmicks of any kind. If they do not specify format for your query letter, 12pt times new roman font is the norm, single spaced. One page. No more.
Now we get to the goods. What's in a query?