For short term purposes, it may work. After a while, the effect of the fear wears off and you’re back to where you started. In the long run, fear is useless.
God effectively used fear for short term communication of his plan for their way of life (Exodus 20:19-21). But the ultimate purpose was that their hearts would be transformed.
Use fear sparingly. Rather aim for heart transformation and changing of values. You’ll get better long term results.