Wiktionary
scare straight
vb. (context transitive idiomatic English) To frighten (someone) to such a degree that a significant improvement in behavior results.