First, write a book. One you think is great. This is what I did once I finished Rats. Then I read them. Each book recommended that writers find agents to represent them.
Agents know the editors.
They're more likely to get your manuscript read. Unsolicited manuscripts typically get stacked in slush piles at publishing houses. Plus, if you do manage to sell your manuscript, they're more likely to get you a good deal. I wrote a one-page query letter explaining what the book was about and who I was. I sent the query to thirty-three agencies that I knew from researching the books handled the sort of YA fiction I had written.