idiom
get a taste of your own medicine
recibir una dosis de tu propia medicina
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**.
Él siempre es grosero con la gente, así que me alegra que finalmente recibió una dosis de su propia medicina.