Taste of your own medicine:
Means that something happens to you, or is done to you, that you have done to someone else.
#english-idioms