The definition of put one’s foot in one’s mouth is:
(idiom) to say something that is really embarrassing
A: This is a great party.
B: Yeah it is!
A: Whose house is this? It is so ugly.
B: It’s my house.
A: Oh. I just put my foot in my mouth.
Charles put his foot in his mouth when he asked the overweight girl if she was pregnant.
After telling the student that he was going to fail the class, the professor put his foot in his mouth when the student got 100% on the final exam.