Comic relief

Comic relief is the inclusion of a humorous character, scene, or witty dialogue in an otherwise serious work, often to relieve tension.
Definition.
Comic relief usually means a releasing of emotional or other tension resulting from a comic episode interposed in the midst of serious or tragic elements in a drama. Comic relief often takes the form of a bumbling, wisecracking sidekick of the hero or villain in a work of fiction. A sidekick used for comic relief will usually comment on the absurdity of the hero's situation and make comments that would be inappropriate for a character who is to be taken seriously. Other characters may use comic relief as a means to irritate others or keep themselves confident.
Use.
Sometimes comic relief characters will appear in fiction that is comic. This generally occurs when the work enters a dramatic moment, but the character continues to be comical regardless.
Greek tragedy did not allow any comic relief within the drama, but had a tradition of concluding a series of several tragic performances with a humorous satyr play. Even the Elizabethan critic Sidney following Horace’s "Ars Poetica" pleaded for the exclusion of comic elements from a tragic drama. But in the Renaissance England Marlowe among the University Wits introduced comic relief through the presentation of crude scenes in Doctor Faustus following the native tradition of Interlude which was usually introduced between two tragic plays. In fact, in the classical tradition the mingling of the tragic and the comic was not allowed.
Examples.
William Shakespeare deviated from the classical tradition and used comic relief in "Hamlet", "Macbeth", "Othello", "The Merchant of Venice" and "Romeo and Juliet". The Porter scene in "Macbeth", the grave-digger scene in "Hamlet" and the gulling of Roderigo provide immense comic relief. The mockery of the fool in "King Lear" may also be regarded as a comic relief.