I think establishing an open, honest relationship with our kids is probably the most important thing a parent can do.
This is one of the best books a parent can read, ever:
And you do this by being open and honest yourself, and also listening to them. Really listening to them.
And when they talk to you, try your best not to react right away. If something they say concerns or worries you, try hard to sort of have a poker face when the kids tell you things, whatever they may be. On your own time, consider a logical appropriate response, and then go back to them in a gentle and respectful way when you are calm.
We are the parents, yes, but we do not have all the answers. It's better to be "all ears" than to try to have all the answers.
If our kids feel safe talking to us, we have a good shot at being the person they feel safe and comfortable with when they are faced with life challenges - like being offered pot on the school playground (this happened with our oldest son) or being hugged by a strange older girl at the park (also happened with older son).
If our kids don't feel safe talking with us about weird stuff that goes on in their everyday life, they will turn to their peers (who may or may not be a good influence) or they will hold it inside and it will fester, causing problems.
Also - something we do with our kids (they are both teenagers) - we have made sure over the years to let him know how to escape certain situations should they ever arise. For example, if our kids are at a friends house for a sleepover or hanging out or whatever... and someone starts drinking or using drugs, our kids know they can text us our secret family code, discreetly (they can say they have to use the bathroom, then text us from the bathroom... this way no one overhears their voices talking to us)... then we will either come pick them up or we will call them and give them a legitimate excuse to have to leave suddenly.
If someone offers them "a hit" or whatever, we've talked to them about saying something like, "Oh, man, I am on prescription meds so I shouldn't right now..." We tell them it's OK to lie in certain situations - if it means protecting themselves or getting themselves out of a bad situation.
Things like this allow them to "save face" and gives them a way to remove themselves from a situation where they may otherwise have felt peer pressured into doing something they don't want to do.
(And luckily, so far, our kids don't seem to want to do drugs or alcohol.)
And also - keeping them busy. Volunteering, jobs, chores, sports, music, whatever they are into. What we've noticed is that the kids that have gotten into the crowd that binge drink and abuse drugs are either the football or basketball players, or the ones that aren't involved with anything at all. So we've steered our kids away from those groups - so far so good.
(I don't mean to say anything bad about basketball or football... it might just be where we live... but in our city, those kids love to "party" and they sort of have a bad reputation for drugs and alcohol.)