In act 3, scenes 2 and 3, Prince Hamlet puts on a play for the court in which actors perform a scene where a queen assures her husband, the king, that she would never remarry, even if he were to die. In the next scene in the play, the king's own brother murders the king by pouring poison into his ear. This is exactly how Hamlet believes his uncle Claudius (now King Claudius) has recently murdered his father, King Hamlet. He wants to watch Claudius's reaction to this performance to see if he shows guilt. Claudius stands up from his seat and leaves the room in haste upon witnessing a re-enactment of the murder. Hamlet realizes he is guilty. This is the anagnorisis, the point at which Prince Hamlet discovers the horrible truth of his situation.
A previous anagnorisis occurs in act 1, scene 2, when Prince Hamlet rehearses recent events and realizes that his mother must not have loved her husband, his father, as much as she had pretended if she was able to remarry within a month. He ironically remarks that they used the food from the funeral to furnish the wedding. His mother must be selfish, dishonest, and conniving, he concludes. If that is true, then everyone must be false, and the world is hardly worth living in. This horrible realization leads him to the contemplation of suicide.
Anagnorisis is the moment in a story when the protagonist realizes the truth of their predicament or the truth about some other character's real identity.