Often, when mistakes are made, a person spends much time and emotional energy apportioning blame or justifying what was said or done.
Instead, when your words offend someone, why not simply apologize, put things right, and keep your friendship intact.
Have you done something wrong and caused inconvenience or worse to yourself or somebody else? Rather than berate yourself or accuse others, why not simply do your best to correct matters?
To insist that the fault lies elsewhere will almost certainly prolong unnecessary tension and allow the problem to intensify. Instead, learn, correct, and move on.