Dramatic irony occurs when there is an apparent contrast between what a character believes to be true and what you, as the reader or audience member, knows to be true. In this case, you become part of the use of irony. Words and actions have an additional, ironic meaning due to the reader's knowledge. Oftentimes, readers know more than a character knows. The irony heightens when the character eventually reacts and discovers the truth. Tragic irony, a kind of dramatic irony, occurs when a character who is unaware of their being a victim of disaster uses words that have more weight to the reader, who is aware of their doomed fate. An example might be a character killing someone in battle, not realizing it is his son, which the audience knows.
With situational irony, expectations raised by a situation are reversed, making the consequences and reality of the situation surprising and unexpected. The reader's expectations and what is deemed appropriate create tension in the story. Situational irony is one of the most common forms of irony in literature and arguably a more subtle kind of irony since it builds upon the events in a story rather than offer an ironic sentence.
This type of irony is named after Socrates' infamous teaching method. Here, Socrates pretends to be ignorant and open to opposing views and questions other characters. As these characters speak and are questioned on their intentions and ideas, they are revealed as foolish and idiotic. Coupled with feigned ignorance, Socratic irony eventually exposes the weakness and ignorance of a character's position in a humorous way.
A kind of device that is also closely connected to sarcasm, verbal irony occurs when a character says something but means something entirely different. What is said or done is oftentimes meant to convey the literal opposite. For instance, verbal irony can happen when praising something that is actually meant as an insult. Verbal irony is also a common, everyday rhetorical device.