Being immune to peer pressure is a good start. That is something you can teach.

I remember my UVic dorm roommate starting to smoke. He thought he would not get hooked, and told me that I should try it. When I declined he laughed and told me that I was "afraid". 

I had the example of my terminally ill from smoking father as a cautionary tale, but some of my siblings became smokers, even given the same in your face reality check.

It shows up in other ways. One of my son's friends tried to convince him to download bootleg software. Then his friend got infected with malware bundled with illegal copies of software and tried to download and run bogus copies of antivirus software. -)

I taught my children that "this is stealing" in regards to making illegal copies, and told them that if they thought that software, music or other Copyright protected material was too expensive they should think of it as a marketing opportunity, to come up with a cheaper product of their own.