Someone said joke is the sudden death of an intermediate language learner. I found it to be so true.
I don't remember how many times I smiled politely or even pretended to laugh at some English jokes I didn't quite get. It became such a bad habit that I got caught once by my cousin. We were watching a comedy, a Hollywood movie, when she asked me what the actor just said that made me laugh. I looked at her confusingly. "Was I laughing? Well then, never mind."
I felt lucky she was the one asking the question. Native speakers usually wouldn't question you. They assume you, an intermediate learner who can speak fluent English, should already have the cultural knowledge and background to under the jokes they are telling, for example, knowing a main character from a popular TV program in the 60s or 70s.
Non-native speakers can easily get tripped on those. I found watching lots of comedies help. Not the homemade YouTube videos, (because they are harder to understand and some were just nuts), but rather TV
sitcoms,
stand-up comedies, etc.
One of my Chinese friends is a natural born comedian. Being at the center of every party we had, he'd be cracking jokes all evening long, in Chinese of course. One day, after being in US for almost 10 years, he finally announced: "I can do it now! I can crack jokes in English now!" No small amount of achievements, believe it or not.
Joke doesn't have to be sudden death if we learn to understand it and tell it too.