To come up with good jokes, choose the target and the point of ridicule, and make sure the joke contains an element of realism along with exaggeration, emotion and a surprise ending. Combine these elements, and time your delivery for the best effect.
The target of your joke could be any person, place, thing or idea. Choose a target that your audience finds familiar, and pick an important element of that target as the point of ridicule. Ridicule does not have to be hostile or mean-spirited. Ensure the joke is real for the audience by mentioning some aspect to which they can relate, and exaggerate the point of ridicule for comedic effect. Engage listeners by telling a story, asking a question or mentioning an emotional or intimate topic at the start of the joke. Deliver the surprise at the end of a one-liner or longer story-style joke, or give the punchline answer to a question.
For example, telling a joke for students and choosing a library as the target, with its very real large collection of stories as the point of ridicule, can help you formulate a take on one classic joke. Exaggerate the number of stories in the collection, and then add a surprise based on the multiple meanings of the word "story." Tie in to emotion and interest using a question-and-answer format. This gives a joke that runs along the lines of "What million-story building is found in almost every major city?" The punchline is "The library."