A common misconception treats "To be or not to be" as a discrete poem by Shakespeare. In fact, it is the opening line of Hamlet's soliloquy in Act 3, Scene 1 of Hamlet—a dramatic speech embedded within a play, not a lyric poem composed for the page.
The speech explores existence versus non-existence, the nobility of endurance versus action, the terror of the unknown after death ("the undiscovered country"), and the paralysis of overthinking ("thus conscience does make cowards of us all"). Its power derives partly from context: a prince pretending madness, watched by a king and counselor, speaking truths he cannot speak directly.
Extracting it as a standalone poem strips away the dramatic irony, the political danger, and the character psychology that give the lines their specific weight. It is a moment in a life, not a statement for the ages—though it has become both.