Sinners cannot live in heaven with God, or heaven would turn into Hell. We all have to be purified to live in God's presence and to live in perfect harmony and love with our brothers. A common belief is that all fleshly Christians still sinning will be instantly purified in the last minute of their lives for them live in heaven.
Once instantly purified, we would drift back into the same patterns of selfish behaviors that cause us to embrace sin. So in this life or the next, we have to:
1) Discover the bitterness of the passions and pleasures that our hearts desire.
2) Over time suffer the consequences of our passions and pleasures, while longing to have them removed by desperately seeking the grace of God to be changed.
In Hell, our passions are unrestrained, similar to how we are without restraint to lusts and violence in our dreams. For our passions are the worst of tyrants. When we are placed so that we are entirely given up to them, they will torment the heart, and, like a torrent, sweep all before them, and yet never be satisfied. We must discover that true liberty is to be found only in him, whose truth shall set us free, and who shall lead us to understand only in virtuous actions are we really free.
In this way, when our heart's defects are removed, one at a time, we are certain not to return to sin in our free wills. Love never insists on its own way, instead it helps us see the error of the wrong way, so we can choose the right way; and then rewards us with the grace of change, finally resulting in purity.