"OMG, you have TWO agents?! How in the world did you manage that?"
I get this question a lot. The first part of the answer I got from a mentor of mine who is a NY Times Bestselling author: Write a great book. Sounds easy enough right?! Hah, don't we wish.
Next you have to do your research and pick agents that represent the kind of book you've written. There are some great websites that allow you to search for agents based on what they represent. There is also a book put out every year called Jeff Herman's Guide to Book Publishers, Editors, & Literary Agents, its fantastic. If you can attend conferences, I highly recommend that because meeting an agent in person gives you a much better feel for who they are and how they might work than any amount of writing on a website ever will.
Enter contests, both of the pitching variety you see on Twitter and blogs and especially at conferences and workshops. That is how I landed my two agents. My novel was runner up in a contest at a conference and they both loved it so much, they offered dual representation.
Now you need to write a great query letter. They're hard. There are lots of formulas out there that can help guide you, but the bottom line is that you have to learn to sell your story. Problem, stakes, resolution. Get those in and you're off to a good start.
Next write that synopsis, some agents will ask for it with the query letter, some after they've read your query letter and become interested. A synopsis should read somewhat like the inside cover of your book. You'll add a little more info than you would on the cover of your book, a little more of the meat of the story that you want to tell an agent but wouldn't necessarily reveal to a potential reader.
Then, cross your fingers, pray, meditate, do whatever it is that helps because it could be a long wait. While you're waiting write your next book, and keep improving your writing skills.
Best of luck!