Penance simply means torturing own body with austerities. It is performed mainly for the sin one has committed. And In some form of Indian religion, it is performed for spiritual realization. However, by torturing own body and mind in the name of penance, one cannot realize anything worthwhile in their life.
Some renounce worldly pleasures and comforts to remain pure and in control. Some have even gone to the extent of torturing their body in the name of penance like fasting, lying on rocks hated by Sun, walking barefoot on thorns, standing in ice freeze water, etc.
Performing penance either for getting cleansed of their sins or for realization of God is not a right path. God resides within ourselves. After undergoing all sorts of penances, If one cannot realize God within themselves, then all penances are spoiled. If one realize God within themselves, then there is no need of penance.
Always keep in mind, our senses are made to enjoy worldly pleasures and comforts. Only attachment to them, over-indulgence to them, constant thinking and talking about them, keeps one away from the spiritual realization. So enjoy worldly pleasures and comforts without getting attached to them.