get a taste of your own medicine
To be treated the same unpleasant way you have treated others; to suffer the consequences of your own behavior.
Learn English idioms with meanings and examples