In the Phaedo Plato through Socrates (or Socrates through Plato) called philosophy "a preparation for death". If Fear of Death is the topic then Phaedo is the dialog to read.
Then, Simmias, as the true philosophers are ever studying death, to them, of all men, death is the least terrible. Look at the matter in this way: how inconsistent of them to have been always enemies of the body, and wanting to have the soul alone, and when this is granted to them, to be trembling and repining; instead of rejoicing at their departing to that place where, when they arrive, they hope to gain that which in life they loved (and this was wisdom), and at the same time to be rid of the company of their enemy. Many a man has been willing to go to the world below in the hope of seeing there an earthly love, or wife, or son, and conversing with them. And will he who is a true lover of wisdom, and is persuaded in like manner that only in the world below he can worthily enjoy her, still repine at death? Will he not depart with joy? Surely he will, my friend, if he be a true philosopher. For he will have a firm conviction that there only, and nowhere else, he can find wisdom in her purity. And if this be true, he would be very absurd, as I was saying, if he were to fear death.
It by no means ends there. It goes on and on addressing many other questions about death and the fear of death but I don't want to quote the whole dialog here.
This is also the dialog that ends with Socrates last words. "Crito, we owe Asclepius a rooster." Asclepius is the god of medicine so the implication is that life is a disease and death is the cure.
These last words are a bit disappointing as Nietzsche pointed out. Nietzsche thought it was out of character for Socrates to say such a thing.
Is it necessary to despise life, to call it a disease, in order to face death? It's kind of like saying those grapes were sour anyway. These are very disappointing last words for someone so wise. On this point I happen to agree with Nietzsche.
Jesus probably beat Socrates as far as (attributed) last words go. "It is finished!" I think Nietzsche would agree that these last words are more life affirming and indicative of a life well lived. "Mission complete" or "I have done what I was here to do". Socrates could have said something similar to this but according to the dialog he said the little quip about the rooster.
Of course, it would ridiculous to judge Socrates, or for that matter Jesus, by last words alone.
I cannot mention last words without mentioning Japanese Death Poems. These Zen monks made an art of giving last words in Haiku form.
Japanese Death Poetry