Yes, I did indeed once hold seminars on How To Do Jokes. They were in some ways jokes in themselves, because there are inherently funny people and there are some who will never be funny as long as their sphincters point to the ground.
I used to cover Freud's Seven Jokes
Absurdity
Allusion
Analogy
Exaggeration
Faulty reasoning
Play on words
Reproach
Well, I say "cover" in the sense that I admitted I had not a clue what he was on about, and strongly suspected he was as funny as a fire in a geriatric ward.
There are other versions of the "There Are Only Seven Jokes" theory, for instance:
Slapstick, Exploitation, Class Consciousness, Concealment, Surprise, Dramatic Irony and Misunderstanding.
So it depends who you talk to. My view is that anything can be funny, even the most hideous acts, and no definitive "list" suffices.
I gave a couple of examples of my favourite jokes, with explanations of why they worked and of incidents where humourless people tried to be funny, dissecting the reasons why they weren't.
I finished with a demonstration of how you COULD be funny if you had the knack of word play. I drew two lions hiding in long grass stalking two impala-type deer. The image itself wasn't funny at all, until I wrote the punchline "Lunch Boks". That always got a titter and a couple of "aaaah"s.
I'm with Roger in that I believe analyzing your OWN humour can be destructive or pretentious at least. I never worry about how or why I come up with gags, though I do obsess sometimes about where a comma should be placed in the punchline. On occasion I don't actually know if I have a gag at all, or whether it's just me who thinks it's funny, but I draw it anyway and see if anyone gets it.