Sayyiduna Abdullah bin Ja'far (may Allah be pleased with him) narrates from Sayyiduna Ali bin Abi Talib (may Allah be pleased with him) that he said: "The Messenger of Allah (peace and blessings be upon him) taught me these words and commanded me that, if any distress or hardship befell me, I should say them: 'La ilaha illallahu al-Karimu al-Halimu, subhanahu, tabaraka Allahu Rabbu al-'arshi al-'azim, al-hamdu lillahi Rabbi al-'alamin' (There is no god but Allah, the Most Generous, the Forbearing; glory be to Him; blessed is Allah, Lord of the Mighty Throne; all praise is for Allah, Lord of all the worlds)."
And Sayyiduna Abdullah bin Ja'far (may Allah be pleased with him) used to prompt a dying person with these words, recite them and blow over one suffering from fever, and teach them to those of his daughters who lived away from home (after marriage).
Hadith Referenceفضائل الصحابة / أخبار أمير المؤمنين علي بن أبي طالب وزهده رضوان الله عليه / 1124
Hadith Gradingمحدثین:إسناده حسن
Hadith Takhrij«حکم الحدیث فضائل الصحابہ محققاً تنسیق وصي الله بن محمد عباس - مکتبہ شاملہ :قال وصي الله عباس: إسناده حسن وعبدالله بن الهاد هو عبدالله بن شداد الليثي أبو الوليد المدني ولد على عهد = النبي ﷺ من كبار التابعين وثقاتهم، مات مقتولا سنة ٨١ على خلاف. . » «مسند الامام احمد: 94/1»