Meaning of “It serves her/him/you right!” - Learner’s Dictionary

It serves her/him/you right!

informal

something you say about a bad thing that has happened to a person and that they deserve:

So she left him, did she? Serves him right!

(Definition of “It serves her/him/you right!” from the Cambridge Learner’s Dictionary © Cambridge University Press)