I worked as the manager of the electronics department at a local drug store for quite a few years. During that time, I ran into quite a few difficult customers who were practically impossible to please. Here are some of the strategies for dealing with them that I found most effective:
1. Learn to listen.  Even if you don't agree with what the customer is saying or you know that they are wrong, listen patiently to what they have to say. Interrupting them, finishing their statements for them, or looking bored or distracted while they are talking will only make the problem worse. Instead, focus on what they are saying and let them finish before you respond. Make eye contact and nod periodically while they are speaking so that they know that you are listening.
2. Try to see things from their point of view. Even if the customer is wrong, try to understand where they are coming from. Imagine if you were in the same situation they are. Would you feel the same way they do? For instance, if you paid a lot of money for a product that didn't work when you got it home, you would probably feel frustrated or disappointed as well. Being able to show empathy can go a long way toward building a good rapport with the customer.
3. Don't take it personally.  Sometimes, when customers are angry or frustrated, it can feel like a personal attack. Remember, however, that they are not angry with you. Try to take your emotions out of the equation and view things objectively. If you allow someone to push your buttons and respond with anger of your own, it will only cause the situation to escalate. Instead, try to keep your cool. Speak in a low, even voice. If the customer is extremely agitated or is verbally abusive, you may need to consider getting someone else like a manager who is further up the chain to deal with them.
4. Treat the customer with respect. If you act in a respectful manner, the customer is most likely to do the same. If, on the other hand, you dismiss their concerns or don't act as if what they are saying is valid, chances are things will escalate.
5. Resolve the problem as quickly as possible. The sooner the problem can be resolved, the better impression it will leave on the customer and the less likely things are to get out of hand. Start by asking the customer what they would like you to do to solve the problem. In some cases, you may not be able to do what they want. For instance, perhaps they want their money back on a non-returnable item. If that is the case, you should suggest alternative ways that you can deal with the situation. Perhaps they could get store credit or exchange the item instead. By laying out a clear course of action, you can help the customer feel like you are doing everything you can to resolve the situation. If they aren't happy with any of the choices or if you don't have the power to resolve the problem on your own, you may need to get someone higher up to do it for you.
This video gives an excellent example of how to deal with a difficult customer: