It's just an expression, usually used when one is surprised! I think it's a way to get around using "God" in a casual expression like this.
Other tutors may have more ideas about this!
Oh, my goodness!
===============
Why do we have to use 'goodness' here?
What meaning does 'goodness' have here?
2 answers
I agree with Writeacher. I'm sure you have expressions in Korean that express surprise.