idiom
learn the hard way
Meaning
to learn something through experience, especially through making mistakes
Example
He **learned the hard way** that honesty is the best policy.