He reported God’s messenger as saying, “The magnitude of the reward goes along with the magnitude of the affliction. When God who is great and glorious loves people He afflicts them, and those who accept it gladly receive God’s good pleasure, but those who are displeased receive God’s displeasure.
Anas reported God’s messenger as saying, “When God has a good purpose towards His servant He gives him punishment beforehand in this world, but when He has an evil purpose towards His servant He refrains from dealing with his sin till He takes from him full payment for it on the day of resurrection.”
Abu Huraira reported God’s messenger as saying, “The believing man or woman continues to have affliction in person, property and children so that they (this is a little difficult to translate. The Arabic has “he”, but the pronoun refers to the man or woman mentioned. I have therefore compromised by using the plural) may finally meet God free from sin.”
Tirmidhi transmitted it, and Malik transmitted something similar. Tirmidhi said this is a hasan sahih tradition.
I saw the Prophet when he was dying. He had a drinking-cup containing water, and he would put his hand into the cup, then wipe his face, then say, “O God, help me to bear the evils of death,” or, “the pangs of death.”