How would you convince a rapist/gropper to not be same again?

Can mentality of a rapist or a gropper be changed? or else they remains same always. if you were to convince them to be better for society how would you? my "pov" is that after whatever the incident happens to them, they kindoff get their mind grounded for sometime and as time passes, its "back to basic" time. reminder question: if you were given a chance to convince them to be better how would you?