Abu Hurayrah reported the Messenger of Allah (ﷺ) as saying, "if a thorn pricks a Muslim in this world and he hopes for the reward against it then Allah forgives him his sins on the day of Resurrection".
حَدَّثَنَا عُمَرُ، قَالَ: حَدَّثَنَا أَبِي، قَالَ: حَدَّثَنَا الأَعْمَشُ قَالَ: حَدَّثَنِي أَبُو سُفْيَانَ، عَنْ جَابِرٍ قَالَ: سَمِعْتُ النَّبِيَّ صلى الله عليه وسلم يَقُولُ: مَا مِنْ مُؤْمِنٍ وَلاَ مُؤْمِنَةٍ، وَلاَ مُسْلِمٍ وَلاَ مَسْلَمَةٍ، يَمْرَضُ مَرَضًا إِلاَّ قَصَّ اللَّهُ بِهِ عَنْهُ مِنْ خَطَايَاهُ.
It is narrated by Jabir that he heard the Messenger of Allah (ﷺ) say, "If a believing man or a believing woman or a Muslim man or Muslim woman falls ill then Allah, the exalted, forgives them their sins (because of their illness)."
Ata bin Abu Rabah said that Ibn Abbas asked him if he would like him to show him a woman who would go to paradise. So, he said that he would certainly like (him to show him the woman). Ibn Abbas said to him. "This is a black woman who came to the Prophet and said to him, "Messenger of Allah, I am subject to fits and become uncovered, so make a supplication to Allah to cure me, "The Prophet (ﷺ) said to her, "If you endure it patiently, you will be rewarded with paradise, but if you wish I will make a supplication to Allah to cure you." The woman said, ’I shall endure it. But, (when I get fits) I become uncovered, make supplication to Allah that I may not become uncovered. So, he made a supplication for her."