"To be or not to be, that is the question" this is the phrase that opens the poem, and in a sense, it is like a synthesis of what the author is going to explain later. He is referring to the verb "to be" practically the same as "to exist". The question is: should I live? And by that he is considering that, by being humans, we have the ability to think. In some sort of way, Shakespeare is leading us to the paradox of life and death were human doubting is crucial in the understanding of the two, so there can be a decision.
"to die, to sleep, No more; and by sleep to say we end the heart ache and the thousand natural shocks that flesh is hair to: it is a consummation devoutly to be wished" He is analyzing death and seeing it as the solution of the life he is living at the moment. In some way, he is confirming that being alive is a constant pain and so death is the unique pathway that would lead him to another life, a painless one.
"Thus the conscience does make cowards of us all, and thus the native hue of resolution is slicked o'er with the pale cast of thought" This is the fragment in which the poem determines the reason why Hamlet haven't decided yet nor taken action. This is the