In past experience it has helped to actually write down a joke - for memory's sake. Actually, "jokes" have come to mind in a sleep state. Writing them down and then awakening they would not to seem to be funny, at all, but they are. Go figure

One formula for joke making, as you well know, is to spring the unpredictable conclusion.
Hope this helps.