An alarm or warning can deter someone from doing something. This could be an advertisement saying that smoking can harm your health.
When we talk about deterring people from doing things, we often think of trying to stop them by making it seem too difficult or unpleasant. For example, if a park is known to be very crowded and noisy on weekends, some people might get tired of the hassle and decide not to go there anymore. In this case, the crowds have deterred visitors from going to the park on busy days.
To prevent something from happening.
