It is narrated from Hazrat Abu Saeed Khudri (may Allah be pleased with him) that the Prophet (peace and blessings of Allah be upon him) said: Whatever worry, hardship, grief, illness, or sorrow—even the thoughts "that trouble him"—reach a Muslim, Allah expiates his sins through them.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 11188
Hadith Gradingحکم دارالسلام:حديث صحيح لغيره، وهذا إسناد حسن، م: 2573