In general, there are only three situations when a customer will be unhappy with your business. We will identify each one and talk about a solution that may help you resolve the situation.
Situation 1: Your customer is not happy with the product
In this case, we're using "product" to talk about the item that you sell. It doesn't matter if your product is an actual physical product (like a car or a book or a widget) or a service (like consulting).
When a customer is not happy with a product the problem is often a result of the difference between their perception of value and the value your product actually provides. At times, their concerns could be legitimate; for example, if they receive the product and it's broken. Other times, their concerns may not seem as legitimate to you; for example, if they expected a gold-plated item but only paid you for a silver-plated item.
When you do find a customer who does not receive what they wanted, the easiest choice is to provide a replacement. If it's a broken item, that's an easy choice. If the customer expected an item of greater value, you'll have to make the judgment call whether it is valuable to your business to provide them with the item they were expecting but didn't pay for.
To avoid these situations, it is best to communicate as clearly as possible up front, before the purchase: clarify the value they are purchasing and explain in detail what they should expect with the product. During the transaction, review with them whether or not they are receiving what they are expecting and follow-up afterwards.
Situation 2: Your customer is not happy with the service
In this case, we're using "service" to refer to the customer service you provide throughout the transaction.
When a customer is not happy with the service, it is usually because their expectations for the interaction were different than yours. Sometimes this is a personality issue (they want to be phoned each day throughout the transaction but you only contact customers once a week, for example), other times this is an industry issue (everyone else in your industry does it one way but you do it differently).
When you have a customer who is not happy with the service they are receiving from you, the smartest things to do are apologize and ask them what they expect; then fulfill their request. It rarely costs extra (except, perhaps, by taking up a little more of our time) but the customer will enjoy the service they receive from you and if you correct it part way through the transaction, you'll turn their attitudes around before the end.
To avoid this from happening, be very clear with the customer about how you typically do business and ask them if they are happy with your process.
Situation 3: Your customer is not happy
There are unfortunate times when you get a customer who is just generally unhappy. It may not have anything to do with your product or the service you provide; they're just unhappy people.
When this happens, you'll have to decide whether it is worth your while to keep them on as customers or not. If they spread poisonous talk about you to their friends, then you may be better off not dealing with them.
When you get a customer like this, it's best to simply apologize that you won't be able to serve their needs and ask them to move on. Although this shouldn't be a typical business practice, you should be prepared for the occasional situation when this might arise. Make sure, though, that they are not unhappy as a result of one of the first two situations, beforehand.