For example, Ecclesiastes teaches us: "For the fate of humans and the fate of animals is the same; as one dies, so dies the other. Both have the same breath. Humans are in no way better off than animals" (3:19). There is nothing after death: "The dead know nothing; they have no more reward, and even the memory of them is lost" (9:5). Knowing that we must all die should teach us how to live: "Go your way, eat your bread with joy, drink your wine with a merry heart . . . Let your garments be always white; and let your head lack no ointment. Live joyfully with the wife whom you love all the days of the life of your vanity" (9:7-9). Because of this kind of teaching, Thomas Aquinas identified the author of Ecclesiastes--Solomon--as an Epicurean (Summa Contra Gentiles, III, 27).
Indeed, Epicurus himself elaborated the thought that "the dead know nothing" to show that the fear of death is nonsensical:
Get used to believing that death is nothing to us. For all good and bad consists in sense-experience, and death is the privation of sense-experience. Hence, a correct knowledge of the fact that death is nothing to us makes the mortality of life a matter of contentment, not by adding a limitless time to life, but by removing the longing for immortality. For there is nothing fearful in life for one who has grasped that there is nothing fearful in life for one who has grasped that there is nothing fearful in the absence of life. Thus, he is a fool who says that he fears death not because it will be painful when present but because it is painful when it is still to come. For that which while present causes no distress causes unnecessary pain when merely anticipated. So death, the most frightening of bad things, is nothing to us; since when we exist, death is not yet present, and when death is present, then we do not exist. Therefore, it is relevant neither to the living nor to the dead, since it does not affect the former, and the latter do not exist. But the many sometimes flee death as the greatest of bad things and sometimes choose it as a relief from the bad things in life. But the wise man neither rejects life nor fears death. (Letter to Menoeceus, in The Epicurus Reader, translated and edited by Brad Inwood and L. P. Gerson [Hackett Publishing, 1994], 29).
We rightly fear the loss in death of those we love, and we rightly fear the possibility that the process of dying can be painful. But to fear being dead is nonsense, because no living being can ever be dead. If we do not suffer from the thought that we did not exist before we were born, why suffer from the thought that someday we will not exist? As Michel de Montaigne put it, death "does not concern you dead or alive: alive, because you are; dead, because you are no more."
This remark by Montaigne comes from his essay "That to Philosophize is to Learn to Die," and that title reminds us that learning not to fear death may require a philosophic attitude that is not characteristic of most human beings.
Oddly, however, there is disagreement among the philosophers as to whether they should teach us that death is nothing to us, because our death is our total extinction. Those philosophers in the Epicurean tradition have thought they should teach us this publicly. But those philosophers in the Platonic tradition have thought they should teach us, rather, to anticipate an afterlife with eternal rewards and punishments. And while the Christian theologians embraced the Platonic tradition, they feared the Epicurean tradition (found even in some books of the Bible) as the greatest threat to Christendom.
Although it may be hard for many human beings to accept the Epicurean teaching, that teaching has become widely acceptable at some points in history. In ancient Rome, for example, it became common for some Romans to inscribe on their tombstones Non fui, fui, non sum, non curo. "I was not. I was. I am not. I don't care."
Some previous posts on what Leo Strauss called "the most terrible truth" of Epicureanism can be found here, here, here, here., and here.