As always, my short answer would be: No, you cannot. Nor should you aim to do so, as that is not realistic as a goal.
Before we go any further, we must admit that a customer can be upset for a variety of reasons. Some of them could look like this:
Your brand messed up. Your brand didn't deliver on its promise to this customer.
The customer misunderstood your brand's promise, or your brand miscommunicated the promise.
The customer's expectation was unrealistic and unheard of amongst all the brands in your market.
The customer is upset with most or all brands they interact with.
The customer is loyal to your competition and stopped to try your brand.
Your brand is not even intended for that customer's demographic, yet they gave it a shot and didn't like the experience.
If you think about it, your brand and all of its CX efforts can only address the first two reasons well. You can possibly try to address the fourth reason at some level. However, the rest are all typically cases where it's pretty hard to prevent a customer being upset about your brand.
When faced with an upset customer, how do you know which category their situation falls into? You listen. Sometimes, you might be able to calm the customer down and have a proper conversation. Sometimes, you might have to postpone that for a tiny while, as they may be in no mood to calm down. Either way, the first thing to focus on, in my opinion, would be to listen to what the customer has to say. If nothing else, this gives them the confidence that you take them seriously, that it's worth their time to give you detailed feedback, that you care about your business enough to turn their situation around (or attempt to!).
When you have that proper conversation, it's also a good idea to collect their most significant points of pain/friction and repeat it to them. Here's where you'll know if they are actionable at all, to what degree etc. The next stage is where many brands make a bigger mistake. They make a fresh set of promises to pacify that customer, without knowing if they can keep those promises. I personally think this second lapse damages the brand more than the original one!
I often recommend to frontline teams that they only make finite promises that are fully within their sphere of influence. For example, they can tell the customer that they will get back in 24 hours with the possible next steps. This gives them enough time to discuss the customer's situation internally and arrive at next steps.
Where to go from there deserves a post of its own! Another time!