The proofs regarding calamities being an expiation of sins are many, and when he is patient with them, he is rewarded for his patience.
This is because reward and recompense are only [granted] for a performed action, it being patience [in this case]. As for the calamity itself, this is from the actions of Allah, not from the actions of the slave. It is part of Allah’s repaying the slave for his sin and atoning his sin through it.
In al-Musnad, it was reported that they entered upon Abu ‘Ubayda (radiallahu anhu) during his sickness and informed him that he would be rewarded for his illness. He said, “I earn no reward or this… Rather, calamities are [a means of] forgiveness.” By that, he (may Allah be pleased with him) clarified that he would not be rewarded for the sickness itself, though it would expiate his sins.
[Majmu’ al-Fatawa: 30/361]