From Longman Dictionary of Contemporary Englishsee the error of your wayssee the error of your waysliteraryREALIZE to realize that you have been behaving badly and decide to stop → error
Examples from the Corpus
see the error of your ways• In fact Brian Moore reckoned it would take only twelve days for the administrators to see the error of their ways.