idiom
to learn the hard way
Meaning
to learn by making mistakes or through difficult experiences
Example
He **learned the hard way** that honesty is the best policy.