According to Webster's Unabridged: HUMOR is defined as:
" The mental factulty of discovering, expressing or appreciating ludicrous or absurdly incongrous elements, in ideas, situations, happenings or acts . . . " A changing or uncertain of mind . . "
This pretty much really sums it up . . .
When comes the task of writing gags for cartoons . . . which is a never-ending, on going, consistent, mind exercise, week after week, month after month, year after year . . . I think most cartoonists actually use the same methods . . . I have never heard anything new.
I would suggest to write the definition down on a piece of paper and have it close by so you see it every day. ( And remind yourself of this factual definition )