Every time I'm sick or close to death, my faith in the soul's existence, in the resurrection, and in everlasting life falters. What should I do?
Well, even some of the saints had to endure the same trial as you. St. Therésè of Lisieux for one, and there were others beset by fears and scruples as they died, such as St. Alphonsus and St. Gabriel of Our Lady of Sorrows. It is natural enough that the devil would try to play on our feelings and discomfort.
The Church's prayers for the dying refer to the struggle that you and others often have. I think that you should make a habit of praying daily for a happy death, in God's grace, and praying also for everyone who is going to die this day. Here is a prayer to say:
"O most merciful Jesus, lover of souls, I pray thee by the agonies of thy Sacred Heart, and the sorrows of thine Immaculate Mother, cleanse in thine own Blood the sinners of the world who are now in their agony and to die this day (night). Heart of Jesus, once in agony, have pity on the dying!"
O Blessed Joseph, foster father of Our Lord Jesus Christ and chaste spouse of the Mary the Virgin, pray for us and for those who are giving up their souls this day (night)."