If you’re using a real estate agent to buy or sell a house, here’s how to make sure you get the best deal.