Where do I file the cat, under P for
Pet, F for Felix domesticus, or O for
Ollie (his name)?

2) Slip in some judicious puns. For example, if you're comparing shredders, you might write that you don't want to get snippy, but Brand X is really a cut above, and anyone who doesn't think so simply isn't all that sharp. (Caveat scriptor: your mileage may vary.)

3) Take a metaphor and run it off a cliff of absurdity.

"Okay, so imagine that your desk is an elephant, and you're going to eat it one bite at a time. So first you start with a foot, represented by a desk drawer. The file folders are the toes, and the tabs are the toenails. Any punched-out holes, lost post-its, orphaned notes, or faded fax cover sheets would be elephant toejam. That's probably kind of nasty-smelling, but don't worry; just crumple the whole thing up and make a toejam football out of it, and throw it into the nearest wastebasket."

When I write jokes I'll often begin with stream-of-consciousness "brain vomit," putting every possible thought to paper. I'll mark places I think people would laugh with an asterisk. This is more organic than just trying to think of funny things.

After this you can cross out everything that lacks an asterisk, and rework your sentences so that the asterisk comes at the end. After this you can present your laugh lines to others and learn how well you judged the asterisks. Then practice practice practice.

I know it's a unique technique (as far as I know I'm the only one who does it) but it works well for me.

I'm really bad at oranges.*
I read if you put your thumb in by the stem you can pull off big chunks,
But what I do is just eat apples.*
God made convenient fruit.*
You can just bite it* and your hands don't get sticky.*
Why would you eat coconuts on an island that also has bananas?*
"I didn't bring my machete to lunch.*
I wish there were an alternative.*"
Banana ka-bobs,* banana creole,* banana gumbo.*
Pan fried,* stir fried,* deep fried.*
People die from coconuts.*
Apples help you discover gravity.*

Once you've got a presentable "joke framework," I've found that asking other people for ideas is a great way to improve/replace the jokes.

Here I roughly translate and sum up some advices from Daniele Luttazzi, an italian satirist (original text here) who learned from the best, like Lenny Bruce and Josh Carlin. (Sorry for any mistake, please edit).

The punchline must be a suprise with respect to the preamble. If the surprise is weak the humor will be weak. If the surprise is awkward the humor will be weak too. The difficult part is balancing these two parts (preamble and punchline).

Wordplay is diffult, more than you think (but anglosaxon humor might be quite different in this aspect).

There is a fashion in jokes, too. What made our grandparents laugh might not be that good anymore.

Keep the punchline as dry as possible. Less words is better, except when this hurts the rhythm.

A good joke is based on an idea, not on a commonplace. If you crack a joke on something you are not well enough informed on you won't make people laugh. On the other hand if the joke refers to very specific subjects no one except a bunch of specialists will get it.

What elicits a laugh is the technique of the joke, not its content. When you retell a joke in other words it usually doesn't work.

I think the most important thing is to figure out what kind of humor are YOU good at.

Lauren Ipsum's and Cody Hess's suggestions are how THEY get people to laugh. Gmoore's suggestion is a good one, figure out what makes you laugh, what you think is funny, and then try to duplicate that with your own ideas.

Look at the way you create humor when interacting with other people, and try to deliver that into your writing. If your audience is known (friends, family, colleagues) you might find humor in inside jokes or shared experiences. If you are going for a broader (ie anonymous) audience you should figure out how your humor plays to strangers (people who don't know your brand of humor).

PTerry's writing is a good example of humourous writing out of realistic responses. Most humour comes from unexpected responses, but good humour in fiction comes from realistic responses. You alluded to this by saying characters stay true their crazyness.
–
staticsanFeb 13 '11 at 23:56

Douglas Adams was a master at it: surprising the reader (and the characters); taking clichés and pushing them to the extreme; using anthropomorphism (objects that seems to act on their own); using nonsense, absurdity, craziness. I have read the only trilogy in five volumes (H2G2) a long time ago and just re-read it in French (my native tongue) and I was delighted.
Beside the humor, the guy was good at making a global, consistent plot, which isn't to disdain...

mm, I think it's hard to absorb funny material in a brainstorm without later including or at least paraphrasing it - which may or may not be the effect you are after. I have in my Reader lots of funny steams that I dip into when I need a break: lolcatz and dogs, Dilbert, Coding Horror, Worse than Failure.

Since you are working on How-To manuals, I think the best way to make good comedy in your books is to explain the topic to people you know, but add in jokes as you're doing it. Chances are what your audience finds funny, others will find funny as well.