Jami` at-Tirmidhi, Book 28, Hadith 52 (Tirmidhi 2155)

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."