Those of us in my chaplaincy cohort who were Jewish, or Muslim, or came from traditions which don't do infant baptism, had a lot of conversations that year about how we might handle that situation if it came up. Our hospital's policy was that we only provided baptism in cases of extremis, for babies who were near death or too ill to leave the hospital and be baptized in their home community. (My plan was that I would ask the parents if they wanted to say the words, since as Christians they would find the words more meaningful than I, and I would seek to sanctify the moment with my presence.) Though I thought about it and planned for it, I was never called-upon to serve in that way.
But I did have many experiences with those who were dying. On my first day, when I learned that fascinating tidbit about baptism, I also learned that the Catholic sacrament of the sick -- formerly known as "last rites" -- does require a priest. If a Catholic patient were near dying, we were instructed to call the priest on call and get him in there. During the day, there was usually a priest in the hospital with us; overnight, the on-call priest would be elsewhere, though would come if we paged him. I remember one of the hospital's on-call priests teasing us that if we woke him at 2am for someone who turned out to survive until dawn, he was going to be very miffed at us for ruining his sleep. (He was kidding.) And I remember times when I had to call him in the middle of the night. That was the year I began learning about Jewish customs having to do with sickness and death. I'm pretty sure it's when I first encountered the deathbed vidui.
I've written about different forms of the vidui before. "Vidui" means "confessional prayer," and it comes in several forms. There's one version of it intended for daily use, which really speaks to me, and which I try to say every night before bed. There's another kind of vidui which we say on Yom Kippur. And then there's the one which the tradition instructs us to recite before death. Though there's nothing wrong with saying it at a different time. If needed, the prayer can be recited more than once. There's no superstition attached to it, it's not as though saying it "too soon" will somehow bring death sooner, there's nothing wrong with saying it and then surviving and getting to say it again another day. What the tradition teaches is, when death is imminent (whatever that means to you), it's appropriate for the ill person (or someone else on his/her behalf) to offer a vidui. Here's the version of that prayer which is found in the Reform Rabbi's Manual:
My God and God of all who have gone before me, Author of life and death, I turn to You in trust. Although I pray for life and health, I know that I am mortal. If my life must soon come to an end, let me die, I pray, at peace.
If only my hands were clean and my heart pure! I confess that I have committed sins and left much undone, yet I know also the good that I did or tried to do. May my acts of goodness give meaning to my life, and may my errors be forgiven.
Protector of the bereaved and the helpless, watch over my loved ones. Into Your hand I commit my spirit; redeem it, O God of mercy and truth.
יְיָ מֶֽלֶךְ, יְיָ מַלַך, יְיָ יִמְלֹך לְעוֹלָם וַעֵד / Adonai melech Adonai malach Adonai yimloch l’olam va’ed.
(God reigns; God has reigned; God will reign forever and ever.)
בָּרוּךְ שֵׁם כְּבוֹד מַלְכוּתוֹ לְעוֹלָם וָעֶד. / Baruch shem k’vod malchuto l’olam va’ed.
(Blessed be God’s name whose glorious dominion is forever.)
שְׁמַע יִשְׂרָאֵל, יְיָ אֱלֹהֵינוּ, יְיָ אֶחָֽד: Shema Yisrael Adonai eloheinu Adonai echad.
(Hear, O Israel: Adonai is our God, Adonai is One.)