Hello Miss Snark!
You say that one has to know their agent to send them their work. Well, how do you 'get to know' agents?
Yes from a just-finished-my-first-book-now -what-do-I-do-with-all-this-paper? 'writier',
By "get to know" I don't mean socially. I mean read their website, see what they've sold, try to get a sense of what they are looking for. The flip side of that is that you want to make sure you're querying someone who IS an agent, therefore you want to make sure there are sales listed on the website or Publishers Marketplace OR if the agent is new that they know what they are doing (ie have some sort of background in publishing).
There are lots of places to find out more about this. Just about any "how to query" list will get you started.