deter
To discourage someone from doing something by warning of trouble.
To deter means to discourage someone from doing something by making them worry about the consequences. When a store posts security cameras, they're trying to deter shoplifting. The cameras don't physically stop thieves, but knowing they might get caught makes many people think twice.
A bike lock deters theft. A stern warning from a teacher might deter students from talking during class. Your parents might try to deter you from jumping off the high dive by reminding you it's dangerous. In each case, something makes a person less likely to act by highlighting the risks or unpleasant outcomes.
Sometimes deterring is just making something seem like more trouble than it's worth. A long, difficult hike might deter inexperienced hikers. A complicated recipe might deter someone from trying to bake a soufflé.
Notice that deterring is about prevention, not punishment after the fact. You deter something before it happens. Once your little brother has already tracked mud through the house, it's too late to deter him from doing it. A deterrent is anything that deters: a guard dog is a deterrent, as is the possibility of getting grounded.