It's often used to describe a situation where someone gets what they deserve, particularly if their actions have been harmful or unfair.
Here are some ways to use the word:
* "After years of cheating and lying, the politician finally got his comeuppance when he was exposed and forced to resign."
* "The bully who had tormented others for years got his comeuppance when he was the victim of a prank."
* "The company that had been polluting the environment received its comeuppance when a lawsuit forced it to clean up its act."
In essence, "comeuppance" implies that someone has been punished for their bad behavior.