Hamlet was trying to decide if he should suffer mentally and emotionally while allowing Claudius to get away with murdering Hamlet's father. Hamlet questioned whether he should kill Claudius and possibly suffer the torment of death in so doing. Hamlet is in a state of mixed emotions:
To be, or not to be, that is the question.
Is it nobler in the mind to suffer
The slings and arrows of outrageous fortune
Or to fight against a sea of troubles,
And end them by fighting?
Truly, Hamlet is questioning whether it is to be or not to be in reference to avenging his father's death. His questions are important. Should he just suffer mentally, knowing Claudius killed his father, yet do nothing to avenge his father's death or should he fight and end his life by fighting Claudius? Which act would be more noble? These are the questions that Hamlet is wrestling with at the time of his soliloquy. Is it nobler to suffer mentally and silently or is it nobler to avenge his father's death by fighting Claudius, knowing there is a possibility that his life would end during the fight with Claudius.
While Hamlet is pondering or questioning himself, he is in a struggle. He is not sure what to do. He desires to do the nobler act. If only he knew which act would be nobler? If he should fight Claudius, he could die fighting and then perhaps suffer in the dreams of death:
To die, to sleep,
To sleep! Perhaps to dream. Yes, there's the catch,
For what dreams may come in that sleep of death,
When we have left this life on earth,
Must make us stop. There's the respect
That makes a mess of long life,
No doubt, Hamlet has a decision to make, but he is so confused during his soliloquy until his words come out in the form of the question which ask whether it is "to be or not to be." Hamlet is torn between what is the best approach to take in this situation. Should he fight and possibly die fighting or should he suffer in the mind by doing nothing? Sooner or later, Hamlet must make a definite decision. Of course, the reader knows the outcome, and just as Hamlet feared, death is the ultimate result of Hamlet's course of action.