The soliloquy is essentially all about life and death: "To be or not to be" means "To live or not to live" (or "To live or to die"). Hamlet discusses how painful and miserable human life is, and how death (specifically suicide) would be preferable, would it not be for the fearful uncertainty of what comes after death.