idiom
get a taste of your own medicine
自食其果
Meaning
to be treated in the same unpleasant way that you have treated others
Example
He's always rude to people, so I'm glad he finally **got a taste of his own medicine**.
他总是对别人无礼,所以我很高兴他终于自食其果了。