You have done something wrong. You are sorry for what you did. You wish you had not done something. Someone is upset with you because of what you said or did. You must apologize, and say you are sorry for what you did. You also can say "please forgive me, I'm very sorry. I did not mean to say that. I apologize"
The other person will understand that you are apoligizing, and they will see you are really sorry for what you did. They will say, "I forgive you". "That's okay". "Don't worry about it".
This is not a time to say "excuse me" but you say "forgive me".
At the time you say something wrong, accidentally hurt someone, or do something wrong, at that moment you can say "Oh, excuse me! I didn't mean to say that or do that".