deterrence
The act of stopping bad actions by scaring people with punishment.
Deterrence means preventing someone from doing something by making them afraid of the consequences. When a teacher announces that anyone caught cheating will receive a zero and a call home, that's deterrence: the punishment is meant to stop students from cheating in the first place.
The key to deterrence is that the threat must be real and believable. If a soccer referee never actually gives yellow cards for rough play, players stop worrying about the rule. But if the referee consistently enforces it, players think twice before fouling. The fear of consequences changes their behavior.
Countries use deterrence in defense strategy too. During the Cold War, the United States and the Soviet Union both maintained powerful militaries partly for deterrence: each side hoped that having strong defenses would prevent the other from attacking. A burglar alarm on your house works the same way, discouraging thieves by making them worry about getting caught.
Deterrence doesn't always work perfectly. Some people take risks despite consequences, or they don't believe they'll actually face punishment. But when it does work, deterrence prevents problems before they start, which is often better than dealing with them afterward.