When writing a novel, humor is an excellent tool to have. It can loosen up your reader, make a story more memorable, and give memories for your character to look back upon.
However, when you are using humor, there are two things you shouldn't do; do not use weak humor -humor that isn't really funny- and do not overuse humor. Both of those can ruin a book and make it seem rather cheesy.
In a novel, humor is best done with events. An example would be a comic insult battle (those are really fun to do). Others are easy to make up, but again, I warn you; do not overuse it.
Humorous characters are another way to express humor. I once read a book where one of the characters was extremely vain, and was constantly complementing himself on all of his qualities.
All these, and others are great ways to express humor, but for the third and last time, do not overuse it.