The Messenger of Allah said: "Nothing afflicts the believer, whether fatigue, grief, disease - even a worry that concerns him - except that by it, Allah removes something from his bad deeds."
Jami` at-Tirmidhi Book 10, Hadith 2