In my capacity as a stand-up, I don't do puns, but I imagine if I did, people would regularly be asking me how I come up with so many great ones. The truth is, punning is simple as long as you remember a few key steps. Here is my easy-to-follow guide.
1. Think of a word. The most important step and, remarkably, the one most often neglected by aspiring punnists, fail to think of a word and you're facing an uphill struggle from the off! Ideally it will have at least two syllables, but otherwise the possibilities are almost endless. From something as banal as 'mattress' to something as pretentious as 'banal', you are limited only by the quality of your education.
2. Think of a word that sounds like part of the first word. This is where the magic happens; master it and you're well on your way to mastering puns. Returning to my earlier example of a word - 'mattress' - and focusing on the first syllable, the New Oxford Rhyming Dictionary lists the following as rhyming with 'ma(tt)': 'at', 'bat', 'brat', 'cat', 'chat', 'drat', 'fat', 'flat', 'frat', 'gat', 'gnat', 'hat', 'lat', 'Nat', 'pat', 'plait', 'plat', 'prat', 'rat', 'sat', 'scat', 'shat', 'skat', 'slat', 'spat', 'splat', 'sprat', 'stat', 'tat', 'that' and 'vat'. All would be superb candidates, but a perfect rhyme is by no means essential - if you really want to impress your friends, try experimenting with half-rhymes and homophones!
3. Wait. Now you have your words all lined up and ready to substitute into your other word, the only thing left to do is wait for pertinent context. Unfortunately, as when maturing cheese or wanting to sleep with someone who's below the age of consent, you may find yourself having to wait a long time. To combat this, some punsteristas posit hypothetical situations via the asking of a question to which one of their puns is a valid answer, before answering the question themselves with that pun. For example:
What do you call a mattress made of bats? A bat-tress!
What do you call a mattress made of cats? A cat-tress!
What do you call a mattress made of rats? A rat-tress!
Alternatively, create your own context. Puns can serve as the inspiration for all kinds of projects you otherwise would have had no reason to either think of or pursue. A screenplay about a man who makes mattresses out of hats? Now you have a snappy name for it, why not!
TIP: Be wary of forming puns that sound like existing words. Experienced Benedict Punderbatches are able to use this to their advantage, but novices run the risk of simply confusing people. Consider this Q&A pun that utilises our other example of a word, 'banal':
What do you call a boring flan? A flan-al!
Knowing the source, it's clearly a hilarious piece of wordplay, but get the delivery even slightly wrong and people could just think you're saying 'flannel' in the immediate aftermath of a transient ischaemic attack.
For advanced pun bandits:
Once you've got the hang of substituting words for similar-sounding parts of other words, how about substituting a word for an entire other similar-sounding word as part of a set phrase? This is inherently more difficult since there are fewer set phrases than words, but when you manage it, there's nothing more satisfying. For example:
What do you call a fox on top of a television? A set-top fox!
(The phrase being punned on here is 'set-top box'.)
You now know everything there is to know about puns; feel free to go on Twitter or outside and put what you've learned into practice. Wherever you pun though, please be considerate enough to do so in extreme moderation.