Allow the words, "I'm sorry" to come out of your mouth, quickly, without an excuse or a defense. When you've been made aware of your misstep, own it and take responsibility with a timely admission of guilt.
The longer you wait, the longer you allow for hurt to linger. The more you attempt to explain it away, the less validation you will extend to the offended. The longer you delay, the more time you allow for bitterness to build.
Apologize, and pay attention.
If you can't remember the last time you extended an apology, this, very likely, is a sign of immaturity.
Everyone messes up, sometimes.
You're not the exception.