Godly sorrow for sin leads to repentance.
2 Corinthians 7:8-10
8 For though I made you sorry with a letter, I do not repent, though I did repent: for I perceive that the same epistle hath made you sorry, though it were but for a season.
9 Now I rejoice, not that ye were made sorry, but that ye sorrowed to repentance: for ye were made sorry after a godly manner, that ye might receive damage by us in nothing.
10 For godly sorrow worketh repentance to salvation not to be repented of: but the sorrow of the world worketh death.