"Emergency. Everybody to get from street." The Russians are Coming, the Russians are Coming." (1966).
Humor in writing is like...salt, or hot sauce. A little bit goes a long way. This is especially true when the underlying incident isn't all that funny. That creates a terrible dilemma for a writer.
Recently, a "missile attack, this is no drill" warning was broadcast in Hawaii. Broadcast, in the 2018 style of cell phone messages and the like, in the manner of weather warnings and Amber alerts. Since the crazy little fat boy in North Korea has threatened same, the warning had a ring of authenticity. People took it seriously - can you blame them? There was panic, and more than a few folks called family on the Mainland to say they loved them...and good bye. Only after an extended period had passed was it called off. It hadn't been a good faith error. It was a screw up.
So, not funny.
Writers think differently. The words start to form sentences, paragraphs... Whole blogs, or scenes in a novel. People say things, events unfold and people are...people. They scream, they say earnest things in all seriousness...they make jokes. It helps relieve the tension. It helps gain a little bit of perspective.
But, writers need to be careful not to appear cruel. It is better to have characters point fun at themselves, or a trusted friend. Not at someone who suffers misfortune. Slapstick is fun (for a while) only if the understanding is that everyone is a willing participant. The Three Stooges was funny in large part because the eye pokes, head saws and face slaps turned on Moe as often as anything else.
Two of us, both SWAT negotiators, were huddled next to a house, behind a shield wearing "full battle rattle." helmets, tac vests...and trying to get the attention of a man with a gun hiding in the home next door to where we were. We were using an ancient bull horn - another story - and getting no where. I was droning on about guaranteeing the guy's safety, no one had been hurt... Etc. I was getting no response. If you've ever tried to keep up a running conversation with someone you can't see, who is not responding at all, you know how tiring that is. My back-up, a woman SWAT member who is also a good friend, offered me helpful hints and suggestions, but I was running out of steam. Finally, she leaned over my shoulder and said quietly "Tell him - 'I'm an introvert. You're killing me.'" I started laughing, turned to tell her to shit up, and saw a guy in the window under which we had knelt, taking our picture. Eventually, the guy surrendered.
Now, if we'd had to kill the guy, or one of us had been injured it wouldn't seem all that funny. Finding humor in the pain of others is sadism. But...
Upon hearing about the missile non-attack, restraint was the order of the day. Because my writer's brain went immediately to a 60's, Alan Arkin's impossibly overblown "Russian" accent and a clutch of garishly-dressed Soviet sailors delivering their warning.
Glad it was a mistake.