The poem is based on an existential crisis that Hamlet suffers from. Through the entire monologue (soliloquy) he vacillates between life and death.
The question for Hamlet was whether to continue to exist facing all odds or to give-up in despair and embrace death. He wondered whether it was more noble (nobler) to suffer the ‘slings and arrows’ (metaphor) of an unbearable situation, or to rise up in arms / wage a war against ‘a sea of troubles’ that afflict / badly affect / trouble his life, and by opposing them, end them. His predicament / dilemma continues further and he is unable to decide between life and death. Death allures him as he feels that it will bring him peace through an eternal sleep. He craves for a sleep as he had lost his own. The sleep that comes with death would end all the ‘heartache’ and ‘natural shocks’ that one must endure in the physical form / with that eternal sleep we end the anguish and the thousand natural miseries that human beings have to endure. He believes that so long as we exist in flesh and blood we remain vulnerable to pain and suffering. But, to die would mean, emancipation from the pain. Pondering on the prospect of death he feels that with it would end all his agony. It’s an end that we would all ardently hope for. For Hamlet, to die meant to sleep and to sleep meant to dream. And perhaps this dream would end his woes of the real world and would help him to escape into a pain-free / pleasant / a more agreeable realm. But, there was a problem (rub – obstacle) to it, because in that sleep of death what dreams one might see are not known. Hamlet also wonders what can be the value of a dream when we are liberated from our physical existence, which is susceptible to pain and suffering. Thus the need for a dream, which actually emancipates one from the harsh realities of life, is nullified. (Note: The ‘mortal coil’ may be interpreted in two different ways – 1. Like a snake that leaves its skin behind we leave