Dramatic irony and the subgenre of tragic irony are perhaps most thoroughly illustrated through examples of dramatic or tragic plays. Shakespeare wrote an incredibly famous example of tragic irony (several of them, actually) in the form of a play called Othello.
In the play, the protagonist Othello is the jewel of the Venetian army. In the beginning of the play he marries the lady of his dreams Desdemona, whom he trusts implicitly, against the will of her father and their community. Two men in particular, Iago and Roderigo find the marriage distasteful: Roderigo because he is in love with Desdemona and Iago for reasons that remain somewhat unclear, though it is safe to assume that it could be a combination of cultural hatred, spite and the desire to have Othello's power.
Iago then sets in motion a plan to destroy Othello's marriage, and Othello himself. Knowledge of Iago's desire to destroy Othello's integrity causes the audience to experience a moment of revelation in the opening of the play itself. At a party, Iago plans to get a young soldier named Cassio inebriated enough to incite a fight with Othello. As a more highly ranked officer, Othello dismisses Cassio from his position in the Venetian army.
As soon as Cassio is dismissed from his position, Iago swoops in to recommend Cassio speak to Desdemona, in the hope that she may be able to talk Othello into allowing him back into the army. Once Cassio heads away to speak to Desdemona, Iago pulls Othella aside to tell him that he suspects that Desdemona may be sleeping with Cassio. Othello immediately goes to see his wife, just in time to watch Cassio slink away. The exchange is enough to plant a seed of suspicion in him, though Desdemona is immediately honest with him, asking on behalf of Cassio if he may return to his former position.
As the play continues, Iago continues to plant seeds of doubt, jealousy and hatred in Othello's mind, all the while the audience knows that Iago is manipulating him into mistrusting his wife. Everything comes to a head at last when Iago plants a Desdemona's handkerchief (a gift given to her by Othello) on Cassio and comes to Othello as an "honest friend", to inform him of Desdemona's infidelity. In a rage, Othello storms to Desdemona's room and murders her in her bed. Shortly afterward, it is finally revealed to Othello that, "Honest Iago" was the man responsible for all orchestrating the entire facade. Othello experiences the recognition that comes with ironic tension and realizes that he has unjustly murdered Desdemona, who he promised to always love and trust in an act of tragic irony.