By working on a healthy self esteem. If you love yourself, you will not want to risk yourself or the peaceful mind of someone who you love.
Put them in a padded room ... Strap them to a surface ... Handcuff them ... Get them treatment ... Get them education ... Etc, etc, etc
It all depends on WHAT "risky behavior" you are talking about.
See a doctor.