In the past, real estate agents always represented the seller, whether the agent helped a seller to market and sell a home or helped a buyer find and purchase a home. In other words, agents were at one time legally bound to represent the seller in a residential real estate transaction. In that scenario, the seller paid both the listing agent and the agent who brought the buyer.
Today, agents either represent the buyer, the seller, or both. If you want to sell your home, you can work with a "seller's agent." If you want to buy a home, you can work with a "buyer's agent." Most states require real estate agents to disclose to consumers who they represent. Sometimes an agent will represent the buyer and the seller. A buyer who elects this situation should receive full disclosure on representation. In some states, dual agency affects the real estate professional's fiduciary responsibilities to the seller. The real estate agent you choose should fully disclose how they work with individuals and the options available to you.
Keep in mind that real estate laws differ from state to state and even from locale to locale. For more in-depth answers, talk with a knowledgeable real estate professional and ask about local practices. Be sure you understand and are comfortable with the services of the real estate agent you engage.