In Act III, Scene 3, Hamlet has quietly made his way to the door outside Claudius's chamber. He watches as the king kneels to pray, and recognizes that this would in a way be an ideal time to kill him and be done with it. He decides not to do so, though, out of the possibility that, if caught in prayer, the king might go to heaven, which would defeat the purpose of trying to avenge his father's death in the first place. Instead, he says, he will try to catch the king
When he is drunk asleep; or in his rage;
Or in the incestuous pleasure of his bed;
At game, a-swearing, or about some act
That has no relish of salvation in't...
This will guarantee that Claudius will not make it to heaven, and that his soul will be as "damn'd and black as hell, whereto it goes." Only in this way will his father's murder truly be avenged. Hamlet does not just want to destroy the king's body but his soul as well.