´Narrated Abu Hurairah:` "When the following was revealed: 'Whoever works evil will have the recompense of it... (4:123)' That worried the Muslims, so they complained about that to the Messenger of Allah (ﷺ) and he said: "Seek closeness and be steadfast, and in all that afflicts the believer there is atonement, even a thorn that pricks him, and the hardship he suffers."
Hadith Referenceسنن ترمذي / كتاب تفسير القرآن عن رسول الله صلى الله عليه وسلم / 3038
Hadith Gradingالألبانی:صحيح تخريج الطحاوية (390) ، الضعيفة تحت الحديث (2924)
Sayyiduna Abu Hurairah (may Allah be pleased with him) narrates: When this verse was revealed, «مَنْيَعْمَلْسُوءًايُجْزَبِهِ» (4-an-Nisa:123) "Whoever does evil will be recompensed for it," it became a great cause of concern for the Muslims. The Noble Prophet (peace and blessings be upon him) said: "Avoid excessiveness and remain upright, and receive glad tidings, for whatever distress befalls a believing servant, it becomes an expiation for him—even a thorn that pricks him or any difficulty he faces, that too becomes an expiation for his sins."
Shaykh Muhammad Ibrahim bin Basheer
Benefit: From this hadith, it is established that whoever commits a sin will certainly receive its punishment, as Allah the Exalted has said: ﴿وَمَنيَعْمَلْمِثْقَالَذَرَّةٍشَرًّايَرَهُ﴾ [99-الزلزلة:8] From this hadith, it is also understood that if a believer faces hardship, Allah the Exalted raises his ranks. It is also learned from this that, in times of difficulty, one should keep in view the blessings of Allah. Furthermore, it is understood from this that Allah does not wish to inflict even the pain of a thorn upon a believing servant.
Source: Musnad al-Humaydi: Commentary by Muhammad Ibrahim bin Bashir, Page: 1180