When the sick have renounced all hope of life

Allāhumma’ghfir lī warḥamnī wa alḥiqnī bir-rafīqi ‘l-'A`alā. O Allah, forgive me and have mercy upon me, and join me with the highest companions (in Paradise). Reference: Al-Bukhari7/10, Muslim 4/1893.
As he was dying, the Prophet (ﷺ) dipped his hands in water and wiped his face saying: Lā ilāha illallāh inna li ‘lmawti la’sakarāt. There is none worthy of worship but Allah, surely death has agonies. Reference: Al-Bukhari, cf. Al-Asqalani, Fathul-Bari 8/144. The Hadith also mention him using the Siivak (tooth stick).
Lā ilāha illallāh wallāhu Akbar, lā ilāha illallāhu waḥdah, lā ilāha illallāh waḥdahu lā sharīka lah, lā ilāha illallāh lahu ‘l-mulku wa lahu ‘l-ḥamd, lā ilāha illallāh wa lā ḥawla wa lā quwwata illā billāh. There is none worthy of worship but Allah, Allah is the Most Great. None has the right to be worshipped but Allah alone. None has the right to be worshipped but Allah alone, Who has no partner. There is none worthy of worship but Allah, His is the dominion and His is the praise. There is none worthy of worship but Allah, there is no power and no might but by Allah. Reference: At-Tirmidhi and Ibn Majah. See also Al-Albani, Sahih At-Tirmidhi 3/152 and Sahih Ibn Majah 2/317.