While I would love to provide you a magic trick, an 'abracadabra' of sorts ensuring only the wittiest, most wonderfully funny material finds itself on the page before you, we're all out of luck.
The truth is, there is only one foolproof way to extract the best from your brain and fill your sets (however long) with "A" material:
Write often, write everything and write a lot of crap.
The art of writing comes more naturally to some. If you're lucky, if you lack a little of the natural talent, you make up for it in tenacity and dedication. Regardless, not everything that comes from any of our brains is going to be spectacular all the time.
Even the best comedians write (and discard) more material than will ever grace a stage. "The cream will rise to the top" (insert some other cliche here).
You know that annoying graphic that graces the Instagram feeds of every "inspirational" account? The iceberg with the tip piercing the ocean? The 10% visible to the world is SUCCESS! The 90% underwater is HARD WORK, PERSISTENCE, LATE NIGHTS, SACRIFICES, DISCIPLINE etc, etc. It's true. In the case of comedy writing, the 10% is 'A' MATERIAL; the 90% is all the other crap you thought was funny at the time but didn't quite work for whatever reason.
And you know what? Some of the material you just threw away can be revived again. I'm always amazed by material I see discarded that quickly becomes 'A' material with the addition of a new tag, or a slight restructure (or something external happens in the world and revives it).
The takeaway is write, write, write. However that looks for you. I know comics who can write in their heads. I (although not a comic) need to take notes - and not on an iPhone, I want to physically write things down, so I carry a pretty notebook I secretly feel really good about pulling out and using in public (pretentious? Sure, but it works for me). You've heard it before, but I'll reiterate it; writing is a muscle - exercise it and it will get stronger.
I want to mark this spot to segue into tips for writing for late night and why consistently writing new material is so important (for club bookings, too), but I hate super long posts.
Until next time!
P.S - why am I writing about writing? This is a marketing blog.... Your material is your best marketing tool. Your material is who you are as a comic. You're literally representing yourself. Always remember that.
A mentor of mine once said "comedy is no longer about writing jokes. It's talking about life from your own perspective. It has to be funny, sure, but I want to know about YOU". Take that as you may, but the guy grew one of the biggest comedy brands in the world, he's seen it all.
Any questions? You know where to find me.