Sahih al-Bukhari Book 75, Hadith 8
I visited Allah's Messenger (ﷺ) while he was suffering from a high fever. I said, "O Allah's Messenger (ﷺ)! You
have a high fever." He said, "Yes, I have as much fever as two men of you." I said, "Is it because you
will have a double reward?" He said, "Yes, it is so. No Muslim is afflicted with any harm, even if it
were the prick of a thorn, but that Allah expiates his sins because of that, as a tree sheds its leaves."
I visited the Prophet (ﷺ) during his ailments and he was suffering from a high fever. I said, "You have a high fever. Is it because you will have a double reward for it?" He said, "Yes, for no Muslim is afflicted with any harm but that Allah will remove his sins as the leaves of a tree fall down."
The Prophet (ﷺ) said, "Feed the hungry, visit the sick, and set free the captives."