Apologise to your friend immediately after you’ve been informed you have harmed them in some way.
Obviously, it doesn’t necessarily have to be a friend.
It can be your parents, a spouse or an intimate partner.
It can be anyone.
Sometimes it’s best not to do it exactly straight away, in which case sleeping on it and doing it first thing in the morning is preferred.
I would still class this method as immediately or with a sense of urgency while the circumstance is still fresh, it’s just sometime you really do need to let the dust settle and revisit it the following morning.
Particularly in my life, apologising sincerely for any wrong doings, mistakes or offence I have caused through my actions, have been significantly reduced through the vulnerability.
Taking full responsibility of what had happened is almost always the most effective way of lowering defences and ensuring the strength of the existing relationship is maintained.
Is it too late now to say sorry?