The idiom "to take one's own medicine" means to endure or experience something unpleasant that one has previously inflicted on others. It is often used in a sarcastic manner, as if to say that someone should face the consequences of their actions just like they made others suffer through them.