How not to have a WTF moment

I was wondering how to appy the model instantly when you get into a funny situation in a work meeting or with your kids. Like when something happens that is not expected at all, i.e. kids coming home drunk, sudden accusation from the boss etc.
Thank you!