In the Folio and the 2nd Quarto the 2B soliloquy occurs in 3.1 between the plan to catch the conscience of the King and The Mousetrap/Murder of Gonzago. In the Bad Quarto it is placed near the beginning of 2.2. This is an odd placement and lends itself to the common misconception of suicidal ideation. In the Bad quarto the soliloquy has no motivation except despondency. In the Folio and the 2nd Quarto the soliloquy is in the perfect place for one to ponder the wisdom of the plan to catch the King.
As it is, the soliloquy is about the difficulties in translating thought to action. So, we have Hamlet second guessing himself. The plan to catch the conscience of the king if allowed to fully develop is going to signal to Claudius that Hamlet is a dangerous person. It will set in motion a course of events that will be beyond Hamlet's control and may well be designed to bring about Hamlet's end. Which of course is what happens.
The speech is delivered in the 3rd person. No where does Hamlet actually refer to himself. One argument for this manner of delivery is that Hamlet knows or suspects that he has an audience. So his verbal pondering is cryptic. Another is Hamlet's faulty inductive reasoning. Suffice it to say the speech is given as a universal.
The 2B speech addresses two concepts. First, whether life is worth having and second the impediments of turning resolution into action. The second concept naturally flows from the first because Hamlet realizes that though we just can "be" without doing anything, we can't simply "not be". Hamlet's exploration of "not being" involves 2 ways to "not be". The first is taking arms against a sea of troubles. The second is making your own quietus with a bare bodkin. "Not being" requires some forward action beyond the mere resolution to do so. This is the second part of his soliloquy. Turning resolution into any action is generalized from the specific example of doing something to "not be".
In light of life's burdens is life worth having or not. As nobility Hamlet has had his preconceived notions of what it is to be noble. The chink in the armor is his realization that nobility is not a state of mind bestowed at birth rather it must be acquired. The ultimate conclusion he draws by the end of the soliloquy is that if one settles on being only noble of mind and nothing more then he is a coward -- a paradox, hardly keeping with nobility. We see this expanded in Hamlet's last soliloquy in 4.4. "How all occasions do inform against me..." where Hamlet watches Prince Fortinbras resolve to act for an "eggshell". Again the dichotomy of passive forbearance versus the nobility of action.
The third soliloquy of considerable significance occurs in Act III Sc.-1. It is of great significance because it brings out the inmost trait of Hamlet's character- his speculative turn of mind. It is to be remembered that Hamlet has arranged for the play to be acted the same evening "to catch the conscience of the king." His future course of action depends upon the success of his plan. It is expected that his mind should be engrossed with the outcome of the play and the possible reactions of the king. Instead there of we find him contemplating on the problems of life and death. He is asking himself whether it is nobler to suffer the misfortunes of life or to put on life itself with all its evils and miseries.
To be or not to be :that is the question.
whether it is noble in the mind to suffer
The slings and arrows of outrageous fortune
But that the dread of something after death.
The undiscovered country from whose bourn
No traveller returns, puzzles the will.
The problem ,that Hamlet wants to solve has a universal significance but it has no relation to the stern realities that confront him in the present. The soliloquy strike the key note of Hamlet's character:
And thus thw native hue of resolution
Is sicklied over with the pale cast of thought,
And enterprises of great pitch and moment,
With this regard their currents turn away.
And lose the name of action.
In the last three lines, Hamlet recalls his beloved Ophelia with the earnest request to ask pardon for his sins whenever she prays to God.
Soft you now!
The fair Ophelia! Nymph in thy orisons
Be all my sins remembered.