We ALL have flaws and things we need to improve! That's part of being human. However, when your actions/words hurt your friend/partner's feelings, you need to give a sincere apology!
Let's break down what it means to GIVE a sincere apology! If your friend approaches you and says that they feel hurt by your actions, you could say something like "I am sorry that my actions hurt you and I will try not to do anything like that in the future." A healthy, mature apology. But here's the thing: if your actions don't align with your apology, it didn't mean sh*t. If you really and TRULY care about someone, you would be willing to change your behavior that hurts them (or y'all are NOT destined to be together).
Healthy relationships require communication, which can be really difficult and harsh. Healthy communication requires self-accountability and self-reflection. Things will come up that require you to take a long, hard look at yourself and change your behavior. We all have aspects of ourselves that we don't like and these aspects can bleed over into our relationships, which forces us to change. Self-growth is beautiful and we want friends/partners that make us into better people. But having those kinds of people in your life requires that you know how to properly apologize and change your behavior when it is needed.
Since we have discussed what it means to give a sincere apology, let's talk about what a bullsh*t apology looks like! Anytime someone says "I'm sorry you feel that way" or "that was never my intention," they are totally invalidating how you feel and not apologizing or taking accountability for anything! True friends do not invalidate you or not support you. You cannot help how something makes you feel and as long as you dealt with your emotions in a healthy way, you have done your best to healthy communicate with your friend and they should respect you enough to treat you the same way or they never really were your friend, to begin with.