The phrase implies you'll discover a truth through a bad experience. He didn't take the warnings seriously and found the risks to his cost.
Pro Tip 2/3
Personal Experience
It must be something personally experienced, not witnessed or heard. She skipped studying and learned the material's difficulty to her cost.
Pro Tip 3/3
Emotional Weight
The phrase often carries emotional weight, hinting at regret or a tough lesson. They cut corners on the construction and knew their mistake to their cost.