to start to understand that you have been behaving in a stupid way.
Once Jack came to his senses, he was happy to admit that he'd been wrong.
come to (one's) senses
To start thinking reasonably. I'm glad she finally came to her senses and decided against those hideous bridesmaids' dresses.Don't worry, Paul will come to his senses and agree to the terms of the contract.
come to one's senses
to begin thinking sensibly. I'm glad he finally came to his senses and went on to college.I wish you would come to your senses and look for a better job.