Mend one`s ways

To improve or change one`s habits.

The woman was forced to mend her ways in order to do better at work.