Keywords: serve (serve you right), serve you right
1. Used alone to mean that you feel that what has happened to your addressee was deserved (maybe you had even warned them before hand), and that you hope the experience will serve them as a lesson in the future.
2. You have little sympathy for them. English = 'That'll teach you!', 'Let that be a lesson', 'Serves you right!'