if you get stuck, no ideas are coming and you're in a comedic blind alley, veer away to a totally different subject for a while.
Or stop completely, have a cup of tea and come back to it later.
Lateral thinking techniques are great for this. i'll go into this another time.
Creative thinking has been defined as 'linking the unlinkable'. Remember,: wherever there's a link there's a joke.
When you do find a punchline, don't presume that's the end of the joke. Even if it's funny,
There may well be a couple more, highly relevant gags waiting to be unearthed which you can add to the original joke, magnifying the comedy hugely.
If you do find a couple more, put the funniest last, the second funnest at the beginning and the most average one in the middle.
And so! A Rule of Three joke is born.