Get a taste of your own medicine

This idiom means that someone is experiencing the same negative treatment or behavior that they have inflicted on others. It’s like when someone who has been unkind to others or done something wrong ends up facing a similar situation themselves. It’s a way of saying that they are now understanding how it feels to be on the receiving end of their own actions.
Imagine if someone always made fun of their classmates, and then one day they were the target of jokes themselves. They would be getting a taste of their own medicine. This idiom is often used to suggest that experiencing the consequences of one’s actions can help someone understand the impact of their behavior on others. It can serve as a lesson in empathy and understanding.