If you’re watching a movie about the Titanic and a character leaning on the balcony right before the ship hits the iceberg says, "It's so beautiful I could just die," that’s an example of dramatic irony.
Dramatic irony occurs when the audience knows something that the characters don’t. In the classic myth of Oedipus, Oedipus leaves his family because it has been foretold that he will kill his father and marry his mother. Oedipus doesn’t know, however, that he was adopted. He ends up killing his biological father and marrying his biological mother without realizing it. This is a tragic example of dramatic irony.