Someone once said, the way a comedian and a comic are different is that a comedian says funny things, and a comic says things funny. However, the way they are the same is that what's "funny", and whether or not you laugh, depends not upon what they say; but on what you do.
Humor is a trick done with meanings-- a sleight of mind! Something isn't funny. We make it so through the internal process of "distortion", in which we make conscious shifts in our experience of sensory inputs (i.e., internal visions, sounds and feelings). This is the same process that allows us to daydream or create artistic expressions.  We distort to make sense of something presented as a paradox.  A paradox is an incongruity or striking contrast between two thoughts.
There are many types of paradoxes that lead to humorous experiences. For example, you laugh when something affirms and then denies the same idea, simultaneously.  You laugh when something creates disorder and then quickly resolves that disorder. Timing is of great importance. Consider the Steven Wright quip: "I stopped at a diner for breakfast. The sign outside read, 'Breakfast Served Anytime.' I ordered scrambled eggs during the Renaissance."
For many years, psychologists have attempted to explain the function of humor in human behavior. Although the tenets of their positions vary widely in attempting to explain why we laugh, most have assumed that the individual must interact in some way with the anecdote being described.  We, in effect, translate the substance of that anecdote using our own sensory experience in order to assign  it some meaning. This process, sometimes referred to as a " trans-derivational search", leads to a sense of knowing; an identity with the speaker, story or both. Laughter then becomes a reaction to this identity process, and the paradox is resolved.
Have you ever seen a Gary Larson cartoon? Imagine two bears standing with arms around each other as if posing for a picture. One bear's face appears through the cross-hairs of a hunter's rifle. That bear, as if aware of his dilemma, is grinning and pointing to the other standing next to him.
Consistent with investigations of other human phenomena, those who have studied humor have primarily asked, why; in this instance, why we laugh and why something is humorous. Searching for causes is useful in medicine and law, where their identification can lead directly to a useful outcome, such as a cure or a motive. However, much of the time a "why" question will buy very inefficient information. The "because" will at best be ambiguous and fail apply to any particular purpose, such as helping someone produce a desired change. To wit, despite centuries of investigations and treatises on the psychology of humor, there is little agreement about what will cause people to laugh, and why people vary in what is considered, "funny." Yet, there has been comparatively little concern about the value of humor; its application as a resource in our daily lives!
The value of humor-- both for the initiator of the anecdote and receiver-- rests with the utility of the state of consciousness it produces. The process of interacting with the message and resolving the incongruity with laughter; or actually creating and telling the tale, produces a "mind- set" which is quite different from that which existed moments earlier. Assigning meaning to the tale requires examining several choices stored from past learning, and results in a more creative, flexible, state of consciousness. This can be used resourcefully to alter meanings of less pleasant concerns, when the state of consciousness is quite different.
Care to try something? It's Showtime!  Pause, take a deep breath and think of a humorous situation in which you laughed uncontrollably. Perhaps you attended a show, or heard a comedian, or goofed in some harmless way. Be sure to step into that situation so you can see, hear and feel what you experienced then...
Take a commercial break...  Now, allow a less-pleasant thought to emerge in consciousness... Run it again, while you also access an outstanding element of the humorous state of mind such as the associated feelings that include laughter. Repeatedly alternate thinking of  these two states of mind several times and pay attention to how specifically the less-pleasant thought changes.
Just think of it as stand-up psychology!