Prince Hamlet describes his fear of death in poetic phrases.
To be or not to be, that is the question: ...
To die, to sleep;
To sleep, perchance to dream—aye, there's the rub:
For in that sleep of death, what dreams may come,
When we have shuffled off this mortal coil,
Must give us pause. (III.i.64, 72–76)
He even claims that nobody has knowledge of what may come after death.
But that the dread of something after death,
The undiscovered country, from whose bourn
No traveller returns, puzzles the will,
And makes us rather bear those ills we have, Than fly to others that we know not of. (III.i.86–90)
The young prince has good reason to believe that the soul lives after death. He does know somewhat what dreams may comes for a traveler has returned from that undiscovered country, his father, King Hamlet.
The ghost says he will soon be tormented until the crimes of his life are purged away. The ghost is also forbidden from telling the conditions of his torment.
Ghost of King Hamlet: I am thy father's spirit,
Doom'd for a certain term to walk the night,
And for the day confined to fast in fires,
Till the foul crimes done in my days of nature
Are burnt and purged away. But that I am forbid
To tell the secrets of my prison-house,
I could a tale unfold whose lightest word
Would harrow up thy soul, freeze thy young blood (I.v.14–21)
If young Hamlet believes himself to be pure of heart and who has never committed a crime against anyone, then he should not fear the torments his father's spirit endures.
So why would Prince Hamlet fear death?