When Hamlet pronounces his famous soliloquy in act 3, scene 1, of the play that bears his name, he is at the point of despair. His father is dead. His mother has married his uncle, who has assumed his dead brother's throne, and all within a couple of months. What's more, Hamlet has spoken with the Ghost of his father, who told him that his death was not natural but rather murder, and his own brother, the new king, is the culprit.
Needless to say, Hamlet is overwhelmed by all this. His grief for his father may have been enough to lead this sensitive young man into a hopeless depression, but with everything else piled on top, Hamlet is not even sure he wants to live.
This, indeed, is what Hamlet contemplates in the soliloquy. He somewhat angrily questions whether he should continue to be alive, whether he should continue to suffer the intolerable “slings and arrows of outrageous fortune,” or whether he should pick up his dagger and end it all. Part of him wants to end this “heart-ache,” for he is in great pain from his sorrow. He wishes he could just go to sleep, the sleep of death, and end all the agony.
Yet Hamlet is also afraid. He does not know for sure what lies beyond death, what would be waiting for him if he “shuffled off this mortal coil,” especially by his own hand. God has forbidden suicide, and Hamlet fears to break that command, no matter how tempting the prospect of escape may be. He is not sure what he will be escaping to. It is an “undiscover'd country,” and this stays his hand.
Indeed, Hamlet's puzzlement over this moral difficulty makes him indecisive. He asks many questions in his soliloquy, yet he never finds solid answers to them. For the moment, he remains alive, held back from self-destructive action by his conscience and by the arrival of Ophelia.