How do you balance a sense of justice with forgiveness?

People wrong me and I'm always torn between forgiving them and teaching them a lesson by being cruel so it doesn't happen again and so they realize why what they did was wrong.
How do you balance a sense of justice with forgiveness?
Post Opinion