´It was narrated from Abu Sa’eed Al-Khudri that the Messenger of Allah (ﷺ) said:` “When you enter upon one who is sick, cheer him up and give him hope of a long life, for that does not change anything (of the Divine Decree), but it will cheer the heart of the one who is sick.”
Hadith Referenceسنن ابن ماجه / كتاب الجنائز / 1438
´Abu Sa'eed Al-Khudri narrated that the Messenger of Allah (S.A.W) said:` "When one of you visits the ill, then reassure him regarding his lifespan. Indeed that will not repel anything, but it will comfort his soul."
Shaykh Dr. Abdur Rahman Freywai
Explanation: 1: That is, pray for his long life and recovery.
Note: (In the chain of narration, Musa bin Muhammad bin Ibrahim Taymi is a narrator whose hadith are rejected [munkar al-hadith].)
Source: Sunan al-Tirmidhi – Majlis ‘Ilmi Dar al-Da‘wah, New Delhi Edition, Page: 2087