The agents (both seller's and buyer's) are paid a commission on the sale from the seller. The commission can range anywhere from 2 to 6%, and is some agents will negotiate if you ask.
Since the agent you talk to will represent you (the buyer), they are the "buyer's agent". The seller's agent is the agent who represents the person who owns the house you're buying. All of the commissions and fees should be laid out in the contract that you sign when making the purchase (including the legal fees, closing costs, inspection fees, etc).
Shop around when looking for an agent. Just like with a lawyer, accountant, dentist, or any other professional, some agents are much better than others -- more contacts, better leads for homes, and better negotiating ability with the sellers. Also, although the agent will usually be pretty thorough in selecting properties for you to see, don't be afraid to do your own research and find some on your own as well. There's nothing wrong with finding a property online and telling the agent you want to see it.