After we commit a sin and feel sorry about it, we can always repent and ask the Lord to forgive us (or go to confession if the sin is serious). Then he takes the sin away and we are clean again. But the tendency to sin still remains. To take care of that, you need to surrender to God completely. Once you attain union with him, he removes that as well. Now you live in great peace.