serve someone right
Meaning: If you say "it serves you right", you're telling someone that their problem is the result of their own bad behaviour, and they deserve it.
- You knew it was illegal to smuggle drugs, and now you're in jail. All I can say is it serves you right.
- They're so lazy that it'd serve them right if they failed their exams.