Ibn Qayyim al-Jawziyyah, رحمه الله mentions:
For the people of sins there are three 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 Hell-fire 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 Allaah intends good for His slave, He enters him into one of these three rivers, so he comes purified and cleansed on the Day of Judgement, not requiring the fourth purification.
And the fourth purification:
The river of Hell-fire on Yawm al-Qiyamah.
So swim in the river of repentance and do 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.
Source: Madaarij as-Saalikeen 1/312, Ibn Qayyim al-Jawziyyah, رحمه الله