Some of us like to do the right thing and we like to make people happy. If you fall in that camp, you know well that this is not always possible. As humans, we err, and we can't make people happy all the time. That's simply the way it is. However, we can try to do the right thing and we can try to make people happy. That's a positive direction.
So what do we do when faced with error and unhappiness. First, it's essenetial to own error--if you make a mistake, own it. When you do that you're actually more likely to learn from your error and make less grave errors. And about happiness, the more you think about what your friends, family members, and colleagues need and desire, the better able you will be to make them happy. So get to know loved ones and colleagues well so you can anticipate ways to make them happy. Be attuned and react accordingly.
Not too long ago, I received a gift from loved ones. It was a relatively small gift, but the gift represented the fact that those loved ones had really heard my words when it came to something I truly loved and enjoyed as the gift represented that. Every time I use the gift, I enjoy it and think of their love and kindness. That was a truly wonderful present and acknowledgement of our good connection and care for one another.
You won't be right all the time and you won't make everyone happy, but you can steer your ship in that direction and be willing to accept the imperfect journey that it will be.