Ibn Qayyim said
“For the people of sins there are 3 great rivers with which they purify themselves in this world and if these do not suffice in purifying them, then they are purified in the river of Hellfire on the Day of Judgment:
1. a river of sincere repentance,
2. a river of good deeds that drowns the sins that surround it.
3. and a river of great calamities (that befall the sinner) that expiate (his sins)
Therefore, when Allah intends good for His slave, He enters him into one of these 3 rivers, so he comes purified and cleansed on the Day of Judgement, not requiring the fourth purification.
And the forth purification: The river of Hellfire on Yaum Al-Qiyamah.
So swim in the river of repentance and doing good deeds and have patience in the river of calamities. And do not neglect these before a day comes when you will be drowned in the river of Hell-fire whose fuel is men and stones”
[Madaarij as-Saalikeen 1/312, Ibn Qayyim al-Jawziyyah]