"To be, or not to be; that is the question." With these words, Hamlet begins the most famous dramatic passage in the English language. Given how this statement has been repeated and parodied ad nauseum, it may feel like it has been completely wrung dry of meaning and significance. But, the very fact that it has been so heavily referenced shows that this line has ingrained itself into our consciousness, and continues to haunt us. Why? Probably because of the way in which it frames the challenge between life and death as one between Being and Non-Being.
What's unique about this is that, during Shakespeare's time, death wasn't a state of Non-Being, but a continuation of life in another state. So, to suggest that there was nothing after death was to effectively deny the existence of Heaven and Hell, and possibly God as well. This remains a radical idea today, to say nothing about England under the reign of King James I, a former witch hunter. The potentially illusory nature of the afterlife is further emphasized in the speech when Hamlet calls them "dreams" that only "may come" after death. That is, Heaven and Hell are simply states of mind, ones that vanish upon death. Thus, the question can be read not just as a choice between life and death, but also as a choice between engagement and apathy.
However, I think that the true source of this line's power, as well as that of the speech as a whole, is the way in which it identifies Being with struggle and pain, and Non-Being with peace. Consciousness is presented as a burden, and life itself as a series of challenges that, even if they're overcome, are simply drops in an eternal "sea" that is impossible to ever truly defeat. The fleshly body, through which we experience the world, is just a "mortal coil", one that traps the mind and the soul- assuming that the soul even exists. And this is the major cause of all struggle and pain- that what we can accomplish are limited by what our bodies are capable of accomplishing in the world around us. Only by not existing at all can we find peace. That is why death is compared to sleep, when the mind and body rest to gather energy. But "the rub" is that we can never be absolutely certain about what truly exists after death, and whether there is a peaceful nothingness, or something else, something worse that what we endure in life. Hence, why there's even a question in the first place. Perhaps those struggles truly do pay off in the end; maybe even before the end, as life does have its pleasures. Not even Hamlet, with his almost divine intellect, was able to satisfyingly answer his own question.
Sooner or later, we all must confront Hamlet's question. Whether we feel that the struggles of life are worth confronting in return for its pleasures, or whether we prefer to sleep in a passive apathy, is something we all ask ourselves at one point or another. Hamlet simply asked it first, and worded it especially well. That is why this line, and the entirety of Hamlet as well, has continued to reverberate after all these centuries.