Irony is a literary technique in which what is written or stated is different from or the opposite of what is expected. There are several types of irony. For example, verbal irony is when a person says the opposite of what they mean, often to sarcastic effect, such as when a customer says "Good job," to a waiter who has dropped his tray.
Situational irony also requires one's expectations to be thwarted, but in this case it occurs when an expected outcome does not happen, or its opposite happens instead. Situational irony is also sometimes called an irony of events. The outcome can be serious or humorous, but it is always unexpected.