Hola Mark!
If someone's talking and you need to interrupt them, you say: "disculpa" (informal) or "disculpe" (formal)
If you accidentally bump into someone: "Perdón" - widely used, not very accurate. Or you use "lo siento" or "disculpa" informal or disculpe "formal" but if the bump was too hard or really hurt the other person then you have to say "perdón" "perdóname" (informal) or perdóneme (formal)
If you need to leave you usually just say "lo siento, me tengo que retirar" or "disculpa/disculpe, me tengo que retirar."
I hope this helps! Please feel free to contact me if you have any more questions ! [emoji]