These two hadeeths: the hadeeth of Abu Sa'eed, and Abu Hurayrah and Ibn Mas'ood - may Allah be pleased with them - both have evidence that the individual is pardoned his sins through the grief, hardship and sorrow and similar other things that afflict him. That is among the favours of Allah - free is He from all imperfections and Exalted is He -; He would try His servants with afflictions which will be expiation for his sins and a way of wiping off his shortcomings.
In this world, man cannot ever be happy; he is rather happy one day and sad on another day. One day he'll get a particular thing and another day it will not reach him. He is afflicted by trials in his soul and hardships in his body. Similar he would have adversities in his community, trials in his family; the afflictions of man are uncountable. Nevertheless, the entire affairs of the believer is good; if he is afflicted with hardship he exercises patience and it is better for him, and if joy reaches him, he is thankful and so it is better for him.
So, if an affliction reaches you, do not think that the grief or pain even it were a thorn that pricks you; do not think it is just useless. You will be recompensed with something better than it; your sins will fall off as the leaves fall off the trees; and that is from Allah's bounties. So if the individual has more patience and hope in Allah's rewards; i.e., expecting tremendous bounties, then he has rewards therefrom.
Hence, afflictions have two aspects:
1. Sometimes when it afflicts an individual, he recalls the rewards and hopes to be rewarded by Allah for enduring; he reaps two forms of rewards: expiation of sins and increased good deeds.
2. And at other times, he would be oblivious of this and he becomes worried; he becomes restless or the like. So he would unmindful of the recompense for patience from Allah but the worry and restlessness would be atonement for his sins. Hence, in any case he profits in the affliction that reached him.
He may also gain atonement for sins and sins's fall-off without attaining the rewards because he had not intended that at all and was not patient and expectant of Allah's reward. He may also have two things: expiation of sins and attainment of rewards from Allah – the Mighty and Sublime – as explained earlier.
Thus, whenever an individual is afflicted – even by a thorn prick –, he should remember to hope in the recompense from Allah over the trial so that he would be rewarded for it together with getting expiation for sins. This is among Allah's favours, His benevolence and compassion considering His trying the believer and then rewarding him over the affliction o expiating his sins for him.
So, all praise and gratitude belong to Allah, the Lord of all that exists.