the error of your ways
the error of (one's) ways
What has been wrong, hurtful, or unfair about one's behavior or way of life. He'll never see the error of his ways if he keeps being rewarded for the bad decisions he's made. I'm afraid it took me too long to realize the error of my ways. But it's not too late for you.