'Whenever a Muslim is afflicted by any hardship - whether a stress, an illness, worry, grief, harm, disturbance, or even the prick of a thorn - Allah removes some of the wrong actions (from his record) because of it.'
The Messenger of Allah said:
(Bukhari and Muslim)