Death and Hamlet's contemplation of death are prevalent themes in Hamlet. If you think about it, death is what kicks off the entire drama. If Claudius does not kill King Hamlet, there is no play. The reader is introduced to Prince Hamlet after King Hamlet's death. That death leads to the ghost of King Hamlet appearing to the young Hamlet and asking the prince to seek revenge against Claudius. In other words, death is both a cause and a consequence. Claudius's murder leads Hamlet to revenge which in turn must end in death.
Hamlet does often reflect on both spiritual and physical death. He reflects on physical death in the classic Yorick scene with the skull and the rotting bodies in the cemetery. Hamlet also spends time debating the spiritual consequences of death. Hamlet is not a happy guy. He longs for death to end his suffering, pain, and grief, but he cannot bring himself to commit suicide because he believes that will bring him eternal damnation. "To be or not to be." That is Hamlet's biggest question.
Death often connotes certainty in its role as the end of life. However, Shakespeare uses death to embolden his theme of uncertainty in Hamlet. In the play there are often conflicts between appearance and reality, so by blurring the lines between life and death Shakespeare damages the certainty of death, a phenomena we consider most definite in nature. We see this in Hamlet's father's return in the beginning as a ghost as well as Ophelia's drowning due to her misunderstanding of the world around her. Death is a constant query in Hamlet's mind as he struggles to decipher reality from appearances.