For follow-up discussion and general commentary on the topic. Comments are sorted chronologically.
I think it is appropriate to pray that if the person has to die , they may die at peace with God and be received at the time of their passing.
Some people are terminally ill as a result of severe substance addiction, others are very old, many have progressive degenerative illnesses. It should be individually assessed to formulate a specific prayer.
Old age can't be prayed away. Terminal cancer, being a quadriplegic, being too short, too tall, or anywhere in between, can't be fixed through prayer. There were thousands of people who were born slaves, spent their whole lives praying about it, and died slaves. Hundreds of years of that can cause people to stop praying about it. Or maybe they actually learn to "hear" God. One of His patent answers is, 'Be still and know that I'm God.' (Psalm 46:10)
The psalmist explained it very well. He told of the troubles (they) we face: He says "Let the oceans roar and foam, let the mountains tremble as the waters surge." He says, 'the nation's are in chaos, and their kingdoms crumble!' (vss 3,6.
But he wasn't worried about any of it. Why?
Because God lived there with them. He says 'God causes wars to end.' "He breaks the bow and snaps the spear. He burns the shields with fire." (vs 9).
"God is our fortress." (vs 11)
A fortress is a place of exceptional security; but even strongholds aren't exempt from attack. Being under attack doesn't mean we should be anxious about it. God says if we "be still" we'll see Him for who He is.
God is with the aged, the infirm, the too short and the too tall. The secret to it is to "Be still and KNOW it." Not knowing is what makes the needy think they're wasting their time talking to God.
Some things are not going to change. One of those things is that God won't leave His people. He'll be with you in whatever you're in. Pray to remember that!