Abu Hurairah reported,

When the verse "Whoever does evil will be recompensed for it" [Nisa 4:123] was revealed, it weighed heavily upon the Muslims. The Messenger of Allah ﷺ said, "Come close to the right path and aim for accuracy, for in every misfortune that strikes a Muslim there is an expiation, even a stumble he suffers or a thorn that pricks him."

Azami 3403

Sahih

عن أبي هريرة

لما نزلت: {من يعمل سوءا يجز به} [سورة النساء: ١٢٣] بلغت من المسلمين مبلغا شديدا، فقال رسول الله ﷺ: قاربوا وسددوا، ففي كل ما يصاب به المسلم كفارة، حتى النكبة ينكبها والشوكة يشاكها.

الأعظمي 3403صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Patience in tribulation and illness
Section
Reward of the believer for what afflicts him of illness, grief, or the like
Numbering
Jami al-Kamil 3403 (2nd edition)
Azami 3403