You thought this part was easy. And you’d be half right. The hard part is creating a riveting, suck-them-in-and-make-them-love-you first chapter (heck, first line). We’ll go into that later.
The easy half? Semantics. Number one: the Writing Sample comes after the Query Letter, not before (we’re starting a guide on the Query Letter next time, so I wanted it to come last). Number two (and it’s amazing how few people are able to grasp this): submit what the agent tells you to, in the way they tell you to do it.
This means that you have to read and follow the submission guidelines on the agent’s website. If they want the first three chapters, send them. If they want the first ten pages, send that. Don’t send the whole book, don’t send one chapter when they ask for three, and don’t send a full synopsis unless it is requested. This only tells the agent that you’re not paying attention, and thus, you can’t be too serious about getting published. Even if they read your sample, this attitude is a notch against you, and can make the difference between acceptance and rejection.
Also, if your book is a certain genre, and they are expressly not accepting that genre, then don’t query them. You are wasting your own time.
As for how you send it: paste your Writing Sample into the body of the email. Attachments can flag a Query as spam, and the agent will never read it. Sometimes the agent will make a specific request (e.g. they will ask for a Word document), in which case, do as they ask. It’s really very simple, yet no one seems to do it. That means it’s an easy way to set yourself apart.