Chanakya says that religious activities, charity/pilgrimage, prayer/ worship and fasting/attending discourses, etc. open the way to heaven. So for cleansing your soul, while you are hale and hearty, you must perform all these activities as per the proper practices, otherwise there will be nothing left after death.