The Messenger of Allah ﷺ said, "Prompt your dying to say, 'There is no god but Allah.'"
قال رسول الله ﷺ: القنوا موتاكم لا إله إلا الله.
No references are available.
Muslim narrated it in the Book of Funerals (917) through routes from Abu Khalid Ahmar, from Yazid bin Kaysan, from Abu Hazim, from Abu Hurairah, who said, then he mentioned it. What is meant by "the dying person" here is one whose death is near, while he is still alive. See for more, Book of Funerals.As for prompting after death, it is not established.As for what was narrated from Abu Umama, while he was in the throes of death, he said, "When I die, do with me as the Messenger of Allah ﷺ commanded us to do with our dead. The Messenger of Allah ﷺ commanded us and said, 'When one of your brothers dies and you have leveled the soil over his grave, let one of you stand at the head of his grave, then let him say, "O so-and-so, son of so-and-so," for he hears him but does not answer. Then he says, "O so-and-so, son of so-and-so," whereupon he sits upright. Then he says, "O so-and-so, son of so-and-so," whereupon he says, "Guide us, may Allah have mercy on you," but you do not perceive it. So let him say, "Remember what you departed this world upon, the testimony that there is no deity but Allah and that Muhammad is His slave and messenger, and that you were pleased with Allah as Lord, with Islam as religion, with Muhammad as prophet, and with the Quran as guide." Then Munkar and Nakir will take each other by the hand and say, "Let us go, we will not sit with one who has been prompted with his proof," and Allah will be his advocate against them both.'"A man said, "O Messenger of Allah, what if he does not know his mother's name?" He said, "Then let him trace his lineage to Eve, 'O so-and-so, son of Eve.'"Its chain is daif. Tabarani narrated it in Al-Kabir (8/298-299) from Abu Aqeel Anas bin Salim Khawlani, who said, Muhammad bin Ibrahim bin Ala Himsi narrated to us, who said, Ismail bin Ayyash narrated to us, who said, Abdullah bin Muhammad Qurashi narrated to us, from Yahya bin Abu Kathir, from Saeed bin Abdullah Awdi, who said, I witnessed Abu Umama while he was in the throes of death, and he mentioned the hadith.Haythami said in Majma al-Zawaid (3/45), "Tabarani narrated it in Al-Kabir, and in its chain are a group of people I do not know."I say, in it is Saeed bin Abdullah Awdi, or Azdi, whom Ibn Abu Hatim mentioned in Al-Jarh wal-Tadil, but said nothing about him, and I have found no criticism or endorsement of him. Nawawi said in Al-Majmu (5/304), Its chain is daif. Ibn Salah said, Its chain is not sound. Ibn Qayyim also deemed it daif in Zad Mad.Likewise, what was narrated from Abu Darda is not sound. He said, The Messenger of Allah ﷺ said, "There is no dying person who dies and Ya-Sin is recited beside him but Allah eases it for him." Abu Naeem narrated it in Akhbar Isbahan (657) through the route of Abdul-Majid bin Abu Rawwad, from Marwan bin Salim, from Safwan bin Amr, from Shurayh, from Abu Darda, who mentioned it.Regarding Marwan bin Salim, Abu Hatim said, "His hadith is objectionable," and Saji said, "He is a liar who fabricates hadith," and others besides them have criticized him.The correct view regarding this hadith is that it is a stopped (mawquf) report, as Imam Ahmad narrated it in his Musnad (16969) from Abu Mughira, who said, Safwan narrated to us, who said, the elders narrated to me that they were present with Ghudayf bin Harith Thumali when his death agony grew intense, and he said, "Is there anyone among you who recites Ya-Sin?" He said, So Salih bin Shurayh Sakuni recited it, and when he reached the fortieth verse of it, he passed away. He said, The elders used to say, When it is recited beside the dying person, it eases things for him by it. Safwan said, And Isa bin Mutamir recited it beside Ibn Mabad. End of quote.In its chain are unknown narrators. The elders, it is not known who they are, nor their names or circumstances. And Salih bin Shurayh Sakuni, Abu Zura said of him, "Unknown," as mentioned in Al-Jarh wal-Tadil. Therefore Hafiz related in Talkhis Habir (2/104) from Daraqutni that he said, No hadith is sound on this subject.I say, perhaps Marwan bin Salim the liar raised the hadith, otherwise it is mawquf.The correct practice is seeking forgiveness for the deceased after his burial, and praying that he be granted steadfastness, as Abu Dawud narrated (3221) from Uthman bin Affan, who said, When the Prophet ﷺ finished burying the deceased, he would stand over him and say, "Seek forgiveness for your brother, and ask that he be granted steadfastness, for he is being questioned now." Its chain is hasan.See for further detail the Book of Funerals, which contains many issues related to this subject.