Irrealis moods are the set of grammatical moods that indicate that something is not actually the case. Simply put, they are any verb or sentence moods that are not realis moods. They may be part of expressions of necessity, possibility, requirement, wish or desire, fear, or as part of counterfactual reasonings, etc.
Irrealis verb forms are used when speaking of an event which has not happened, is not likely to happen, or is otherwise far removed from the real course of events. For example, in the sentence "If you had done your homework, you wouldn't have failed the class.", had done is an irrealis verb form.
Some languages have distinct grammatical forms that indicate that the event described by a specific verb is an irrealis verb. Many of the Indo-European languages preserve a subjunctive mood that functions as an irrealis; some also preserve an optative mood that describes events that are wished for or hoped for but not present.