Concerning Shakespeare's Hamlet, in Act 5 Hamlet becomes ready to do whatever is necessary to accomplish his mission. The readiness is all, as he says. Specifically, he does avenge his father and kill Claudius. In that respect, he does get or achieve what the entire play points toward. That which is rotten in the state of Denmark is eliminated.
Of course, in general, however, he dies, his mother dies, Ophelia is dead already, and his family loses the throne of Denmark to Fortinbras. While Hamlet suspects he might die in the pursuit of revenge, and becomes willing to do so, you could hardly say it is what he wants. He seems a bit afraid of dying throughout the play, as one might expect, though the "peace" of death, if there is any, is sometimes on his mind, since he suffers from melancholy or depression.
He, perhaps, seems to accept death in a way similar to how he accepts Fortinbras. Earlier in the play he admires Fortinbras and sees Fortinbras as a would-be acceptable ruler for Denmark. A trace of inevitability is present in his words. Throughout the play, he contemplates existence and death and, by Act 5, seems resigned to it. This appears to seem inevitable to Hamlet, as well.
Does he get what he wants out of life? He lost that before the play even opens. He wants his father to rule and live happily with his mother and, someday, die of natural causes. We see that throughout the play. Having lost that, revenge and his own probable death are the options left for him to right the wrong and correct the situation.
Since we really don't know what he wanted out of his life, we can only speculate. He seemed to enjoy the academic world over the world of politics. From what we know of his age, he seems to be a professional student. If you are over 30 and still in university....
So, he is thrust into a world of politics and maneuvering and one upmanship and plays the game quite well.
Once his father dies, and Hamlet is charged with revenging his death, his life and goals change. He can no longer dream of the ivy towered world of academia.
First he needs to verify the information he gets from the ghost. If it is the truth, he then must find a way to achieve his goal without losing his soul.
Does he succeed? That Claudius dies with massive sin on his head is achieved. Does Hamlet get his revenge? He does but the cost in life is great. Claudius, Gertrude, Polonius, Laertes, Ophilia, Rosencrantz, Guildenstern, and Hamlet himself all die directly or indirectly as a result of Hamlet's revenge.
What happens to Hamlet's soul? "Now cracks a noble heart. Good night sweet prince,/And flights of angels sing thee to thy rest.---" Of course, Horatio is Hamlet's best friend, he would hope for the best.