The definition of comeuppance is getting the punishment you deserve.(noun)
If you always make fun of people who wear glasses and then it turns out that you need glasses too and you get made fun of, this is an example of getting your comeuppance.
See comeuppance in Webster's New World College Dictionary
See comeuppance in American Heritage Dictionary 4
Learn more about comeuppance