There are several methods to create humour. But one of the most effective is to use the element of surprise, or saying something unexpected.
This creates humour.
There are ways to set up the use of surprise.
You can say something that causes the person to think you are going to say one thing, then say the opposite of it.
“I have a lot of discipline, I train five times a week. Five times a day I sit down in front of my computer and practise my Solitaire skills.”
In the above joke, the first sentence creates the expectation that the person speaking believes a lot in hard work. There is the expectation that he is going to say something that shows how much hard work he does. But he instead then reveals that his discipline is applied in playing computer games. This is the opposite of the expectation that was created.
Or you can set it up by using the rule of three. I have written an article on that on this website.
You can also apply the element of the unexpected by using it when you respond to what someone says, by saying something unexpected in your reply.
Nicole: “I am planning to have a Christmas party for my grandparents and their friends. What music do you think I should play?”
Kevin: “Gangster music.”
In the above, during a Christmas party for grandparents, there would be the expectation that the type of music played would be calm and tame. Saying gangster music is the opposite of this expectation.
Note of caution, when making jokes like this, make sure it is with someone that understands it is a joke. The last thing Kevin wants is for Nicole to actually play gangster music at a Christmas party with her grandparents.
Saying what is unexpected or that creates surprise, is an effective method to create humour and make jokes.