I think the most important thing is communication.
Raise the child in an environment where no matter what it is the child is comfortable coming to you before some kid at school when they need advice or don't understand something.
If you can accomplish that, then when the child has questions about sex, drugs or anything else they will let you know.
The other thing is spending daily quality time, where you can find out whats on the childs mind or what they are dealing with.
Families don't spend time together like in years past.
Its mom/dad I got to work, kids - I want to watch tv or got things I want to do.
The times of everyone sitting down to dinner , with no tv on, and the family just enjoying the meal together and discussing their day, is rapidly disappearing.