Writing humor can be tricky. What is funny for some isn't for others, and finding that universally funny situation and joke that works can be a difficult task indeed. Even the best and most experienced joke writers have times they think something is terribly funny, but no one else finds it so. Johnny Carson even turned that into laughs. When his jokes bombed and no one laughed, just his expression as he "squirmed" at the failed joke was enough to get a laugh.
I've had some successful funny material as well as some bombs. Culled from what I've learned both from other writers and my own experiences, here's some points to keep in mind when you want to introduce comedy into your stories or write a comedy.
Keep it natural to your story.
The tendency is to throw in a joke, or force a funny situation or words into a story. Too often, these appear tacked on to both the character and the story. It's obvious they're designed to be funny, and if there's one thing that tends to make something not funny in a story, is when it appears the author is trying to put something funny for the sake of being funny, into the story.
What you want to have happen, however, is for the reader to simply get hit with the humor before he or she realizes its even coming. Most humor in story telling is the unexpected twist, the unforeseen odd situation that blindsides them, and the juxtaposition of the events naturally flowing from the story hits their funny bone. For the reader to not see it coming, to get misdirected in a way that what they expect to happen forms the foundation of making something funny, they need to be in the story, and not clued in, "Hey, now I'm going to write something funny! Watch out! Here it comes!"
Make the humor serve the story, not the story, the humor.
Ever watch one of those old Kung Fu movies? They tend to be a string of fight scenes and the story is added in almost as an after thought, just to provide a backdrop for all the fight scenes. It doesn't matter if the fight scenes were natural to the story. The whole purpose of the plots were to fill in the brief gaps between fight scenes!
Sometimes, that's what happens to people attempting to write "comedy." A weak or nearly non-existent plot is tacked onto a string of jokes or what is believed to be funny dialog. The first rule (yeah, I know I put it second, but see, you didn't expect that...did you?) of writing a good comedy is to first write a good story. Then, find the comedy naturally inherent in the story itself. Some people have a knack of seeing this easier than others, but in most all situations one can find the odd turn of phrase or events that throws a hilarious moment before the reader when they least expect it.
Even when you want to intentionally write a comedy, what you look for is the plot and story line that is original and will create the odd situations that allow you to mine funny moments. I did this in "Confessions of a Zombie's Wife." Zombies aren't exactly comedy material, but a wife whose husband comes back from the dead and they continue to live their lives as married? Priceless. When you have something that surreal, the reader will actually allow you to use some groaners or more clichéd elements, simply because it is in such an usual situation, its funny to see them used where it oddly enough, is natural. Like the zombie, not being able to talk, using Charades to get his point across.
Character is key.
Part of any good story is the characters and how they interact with one another. And it is in the interactions of characters where you can find your most hilarious moments. You put the right personalities together, conflicting with one another, and you can find some funny stuff.
Classic comedy has done this. Laurel and Hardy, Abbot and Costello, The Three Stooges, The Odd Couple, and countless others. Frequently you'll see in movies Jackie Chan produces, that the comedy comes from Jackie's interaction with another person who is usually very opposite his character. By doing it that way, the comedy can come naturally from who they are instead of feeling forced in.
Remember, you're using words!
One difficulty in writing comedy is the lack of visual interpretation. If you are writing jokes for a comedian, or a script for a TV situation comedy/movie, you have the advantage of the live person who can give a funny bit the right effect. Half of a comedian's ability to make people laugh isn't just what he says, but how he says it and what he's doing with his or her expressions when they say it.
Take Bill Cosby's classic discussion between Noah and God. If you just read it, it's not nearly as funny.
God: Noah, I want you to build an ark and put two of every kind of animal in it.
Noah: Right.
Not so funny, but you hear how he says it, and you burst out laughing. It's very difficult to duplicate that on the written page. If you want to try an experiment, try writing a scene as if you were in the audience as a comedian is giving his or her routine, and see if you can make it funny. It can be done, but what you have to work with is much more limited than your standard comedian has at his or her disposal. Plus, you have the added affect in such a scene that the reader is expecting it to be funny, and so you have to work extra hard to really surprise them in a way that hits their funny bone.
And, you don't have the added benefit that a comedian has, the audience's laughter. Group dynamics being what they are, when some people laugh, others will tend to laugh easier. Soon, the simplest expressions can create rolling laughter. But in reading written comedy, the reader doesn't hear any laughter, and if you tell them people laugh at the joke, it will feel like your forcing the reader to believe its funny.
So, comedy within a written story relies much more on the unexpected phrase, turn of events, character clashes that result in funny outcomes, or the plot idea that is itself crazy and hilarious. For instance, and this happened recently--heard it with my own ears--my priest read the Gospel where it refers to the woman Jesus had cast seven demons out of. What did my priest say? The woman that Jesus had cast seven deacons out of! Such an unexpected twists throws an image into your head of Jesus grabbing deacons, one by one, out of this woman and tossing them into a heap. Though it would help in a live situation, you don't need facial expressions, body language, or intonation to help get the funny out of that. The unexpected image the reader gets is what causes the humor in writing, whatever literary device you use to create it.
So, come up with a great story, great characters, and look for the areas where those characteristics will naturally create funny images. An example you say? Check my published page for Dragon Stew, Confessions of a Zombie's Wife, Monkey Madness, and The Call of Nature. And more are on the way!