No, I'm not shouting, and no I'm not angry. It's time for our next charm class! Excuse me is used before you do something that will inconvenience a person but I am sorry is used after. Let's say I need to pass you in the hallway but you are in front of me.
I stop and say "Excuse me," or "Pardon me" but if I accidentally step on your toe or knock books out of your arms while passing I say "I am sorry," (Without sarcasm here) Moms and dads lets use this to speak to our children too, not just require it of them.
Excuse me is also used when you have not heard what someone has said and you need it repeated. You say "Excuse me, could you repeat that" Never say huh? (you are not a grunting pig or other creature.) You could also use "I beg your pardon," here. (Note to parents I beg your pardon is not to be used as a snotty come back to something your child has said that is rude or shocking.)
I beg your pardon is literally begging for forgiveness. In this case for putting someone out by having to repeat what they have already said.