Whenever the Prophet (may Allah's peace and blessings be upon him) visited a sick person, he would say: No harm, (it will be) purification (from sins) if Allah wills
Authentic hadithعن عبدالله بن عباس رضي الله عنهما أنّ النبي صلى الله عليه وسلم دخلَ على أعرابيٍّ يَعُودُه، وكان إذا دَخَلَ على مَن يَعودُه، قال: «لا بأس؛ طَهُور إن شاء الله».
‘Abdullāh ibn ‘Abbās (may Allah be pleased with him) reported that the Prophet (may Allah's peace and blessings be upon him) visited a Bedouin while he was sick, and whenever he visited a sick person he would say: "No harm, (it will be) purification (from sins) if Allah wills."
Explanation
Ibn ‘Abbās (may Allah be pleased with him) reported that the Prophet (may Allah's peace and blessings be upon him) visited a Bedouin while he was sick. Whenever he visited a sick person he would say: "No harm, it will be purification (from sins) if Allah wills." In other words, there will be no harm or hardship upon you, and your illness will be purification from your sins and expiation for your faults. Illness may also cause man's rank to be raised in the afterlife.
Source · Narrated by Bukhari
From the Hadith Encyclopedia (hadeethenc.com).