We use this expression to apologise before or after swearing:
Pardon my French, but this is a bloody mess!
Swear words are often among the first things we learn in a foreign language. However, swearing is considered to be disrespectful and offensive, so here are some ways to express annoyance in English without offending anyone.
Sugar! instead of Shit!
Gosh! instead of God!
What the heck or What on earth…instead of What the hell… (¡Qué demonios…!)
For goodness sake! (¡Por el amor de Dios!)
What in heaven’s name are you doing? (¿Qué demonios estás haciendo?)
You will find more examples in TE! Module 11, Unit 2 in this app.