Your question concerning Hamlet is extremely vague, and could be answered in numerous ways. I'll do my best to guess what you're after.
Just before everyone dies, or at least as they die, all of the plots against Hamlet are revealed. Once the queen mistakenly drinks the poison intended for Hamlet, everything starts to unravel. The queen's swooning, along with Laertes' failure to quickly mortally wound Hamlet during their dual, leads to Laertes' plot to poison Hamlet being revealed, as well as the king's plot to poison Hamlet being revealed. In short, everything is brought out into the open, the evil is expunged, and Denmark is set right.
I hope this unravelling is what you had in mind.