Is it possible to use "demotivate" with something not related to studying or job?
Solution 1:
deter would be a much better fit here.
DETER
: to turn aside, discourage, or prevent from acting; she would not be deterred by threats
Streetworkers are trying to deter young people from committing crimes.
M-W
“Why the gruesome pictures? Because we hope to deter young people from committing the same crimes and because we hope that by looking at pictures relatives will recognize those missing. Because we’re filling a void by providing the raw truth, at a time when everyone wants to forget what’s happened to our country.”
Dallas Morning News
Solution 2:
Demotivate normally carries negative connotations. So one would not normally talk about demotivating people from committing crime.
But discourage is neutral - it can imply something positive or negative. We discourage shoplifters, but equally we make discouraging remarks which people find hurtful.
So in the example you give discourage would seem a better choice than demotivate.
Solution 3:
To the extent that “demotivate/demotivation” implies that the “motivation” (to commit crimes, in your case) already exists and that the "goal" (again in this case) is to “remove” that motivation, in order to maintain at least some form of the word "motivation," you might need to use those two bolded words together (i.e., “remove motivation”) to capture this “positive” sense of “demotivate/demotivation”:
It is difficult to remove motivation from someone who is intent on committing a crime.
(from ‘Physical Security and Safety: A Field Guide for the Practitioner’ and Google Books)