What to say to someone who is dying in islam? What is the dua when someone dies in islam?
The Messenger of Allah (may Allah bless him and grant him peace) has instructed his community to speak of good things when in the company of the ill or dying:
“When you visit one who is sick or dying, say good things, for the angels say ‘Amin‘ to whatever you say.” (Muslim, Jana’iz, 6; Abu Dawud, Jana’iz, 15)
“When one of you visits the sick, offer them words of reassurance and hope regarding their life. Indeed, these will not repel anything that is preordained for them, but will offer comfort to their soul.” (Tirmidhi, Tibb, 35/2087; Ibn Majah, Jana’iz, 1/1438)
Similarly, prompting a dying person to say, ‘Lā ilāha illāllah‘ is a religious obligation. The Messenger of Allah (may Allah bless him and grant him peace) has said:
“Urge those of you who are dying to say, ‘Lā ilāha illāllah‘.” (Muslim, Jana’iz, 1, 2; Abu Dawud, Jana’iz, 15-16/3117)
Great care, kindness and tenderness, however, is required when undertaking this task. It is not right to force the sick person to recite the Profession of Faith, or to be overly insistent. Disturbing or harassing the sick at such a difficult time can cause them to die – Allah forbid – without professing their belief, or to act in a manner contrary to Islamic faith.
Moreover, if a believer has not uttered any worldly words after having uttered the Declaration of Faith, their last words are considered as being the profession of faith, no matter the length of their illness or death throes. It is thus hoped that they will become those to whom the Messenger of Allah has given glad tidings in the Prophetic narration, “He whose last words are, ‘Lā ilāha illāllah‘ (There is no god but Allah) will enter the Garden.” There is therefore no need to repeatedly prompt individuals in such cases.
Furthermore, reciting the Qur’an, especially the Qur’anic chapter Ya-Sin in the company of the dying in a pleasant, soothing voice, is something that has also been encouraged.
 “If a person in the throes of death is one who has spent their life with belief and who has not shown any indication of unbelief only to display unexpected signs of unbelief at the last moment, this is deemed insanity and they cannot be deprived of the treatment that is due to other believers.” (Necip Fâzıl Kısakürek, Îman ve İslâm Atlası, Büyük Doğu Yayınları, Istanbul, 2017, p. 330.)
 Abu Dawud, Jana’iz, 15-16/3116; Ahmad, V, 247; Hakim, I, 503, cf. Bukhari, Jana’iz, 1.
Source: Osman Nuri Topbaş , Journey To Eternity, Erkam Publications