Humor is a cognitive reappraisal technique.
It allows you to interpret difficult situations with a laugh.
Because you’re reintepreting the circumstances as funny, you can more easily step away and reinterpret the situation.
Having a chuckle about the situation creates the space for you to regulate your emotions.