Sayyiduna Abu Huraira (may Allah be pleased with him) narrated: When this verse was revealed: "Whoever does evil will be recompensed for it," it was hard on the Muslims and caused them great distress. They complained about it to the Messenger of Allah (peace and blessings be upon him), so he said: "Remain close and adopt moderation. Whatever hardship befalls a believer, it is an expiation for him, even if a thorn pricks him (that too is a cause for expiation)."
Hadith Referenceمسند اسحاق بن راهويه / كتاب البر و الصلة / 795
Hadith Takhrij«بخاري ، كتاب الاستذان ، باب تسليم الراكب على الماشي ، رقم : 6232 . مسلم ، كتاب السلام ، باب بسلم الراكب على الماشي الخ ، رقم : 2160 . سنن ابوداود ، رقم : 5199 . سنن ترمذي ، رقم : 2703 . ادب المفرد ، رقم : 993 .»