The Messenger of Allah ﷺ said, "There is no believer who is pricked by a thorn in this world and bears it patiently seeking reward, except that his sins will be reduced thereby on the Day of Resurrection."
حدثنا علي بن إسحاق قال أخبرنا عبيد الله بن عبد الرحمن بن عبد الله بن موهب قال حدثني عمي عبيد الله بن عبد الله بن موهب قال سمعت
قال رسول الله ﷺ ما من مؤمن يشاك بشوكة في الدنيا يحتسبها إلا قصر بها من خطاياه يوم القيامة
No references are available.
Its chain of transmission is sahih. Bukhari related it, 5/2139, no. 5324, in the Book of the Sick, chapter on the most severely tested of people being the prophets, and Muslim, 4/1991, no. 2572, in the Book of Righteousness, chapter on the reward of the believer for what befalls him, and Tirmidhi, 3/288, no. 965, in the Book of Funerals, chapter on what has been said about the reward of the sick person, and he said, hasan sahih, and Ibn Abu Shayba, 3/232.