Dramatic irony occurs when the audience knows something that the characters do not, creating tension or humor.
A classic example of dramatic irony can be found in Shakespeare's play Romeo and Juliet. In the final act, Juliet takes a potion that makes her appear dead. The audience is aware that she is not truly dead, but Romeo, believing she is, takes his own life in despair. This creates a heartbreaking moment because the audience understands the tragic misunderstanding that is about to unfold, while the characters do not.
Another example can be seen in the movie Titanic. The audience knows that the ship will sink, but the characters board with excitement, completely unaware of the impending disaster. This knowledge creates a sense of tension and urgency as viewers watch the events unfold.