First of all, you should realise that everyone makes mistakes and you are not an exceptional one. Stay confident in front of others and do not become nervous which will make the situation worst for you.
Remaining confident does not mean that you are not at fault. You should realise and accept your mistake but do not let it overcome you which will make you frustrated.
If you are facing embarrassment because of your mistake then make sure to stay calm and never cry in front of others as it will make your rivals or enemies happy.
The best way to avoid embarrassment is that you should try to laugh along with other people that will make you feel better and others will like this attitude.
Do not let others to judge that you are embarrassed. Instead, make them realise that you do not bother about the situation.
Changing the topic of conversation also helps in avoiding the embarrassment. Try to talk about something else when you experience such a situation.