You can only do so much. After that, you hold on, and hope for the best.
A very good friend had a wonderful daughter. Her birth mother was very wild (quite possibly bipolar), and they had a brief marriage that ended with her leaving town, and losing touch with him, and her daughter. No one knew where she was, or really cared to know. His daughter was not even three when she disappeared, so his second wife was the only mother she ever knew.
He met a good woman, they got married, and he continued his education. His daughter was a delight, and she always had a good home. She had parents, grand parents, and even great grandparents that doted on her. She was always supervised, kept away from bad influences, and generally had a pretty great childhood. She was pretty, and outgoing, and made lots of friends in school.
But, some seismic rumblings began when she hit her teen years. My friend had to accept a teaching position quite far away after he graduated. His daughter had just turned fifteen, and though she was still pretty well behaved, her personality was changing quite rapidly. She did not want to move hundreds of miles away, and leave behind all of her friends. It seemed to act as a triggering event, that sent her on a path that she might not otherwise have gone down. Of course, none of the family really wanted to move, and as I was pretty close to an adopted uncle, I didn't want them to move either. His younger daughter, ten at the time, told me that I should move with them (I've rarely been so flattered). But it was done out of economic necessity.
After the move, things went downhill pretty quickly. Her California style was a bit much for her new school. Her grades went downhill, she began hanging out with a bad crowd, and she began cutting herself. She responded to attempts to discipline her by running away. I ended up with some very substantial telephone bills because I was calling them up so much when she had run away, desperate for news that she was ok. I ended up building them a computer (this was the early 2000's, and they were broke) so that we could keep in touch by email, and save on the phone bills. A couple of times she disappeared for weeks. My friend's younger brother suggested that it was her biological mother coming out in her; as mental illness has a significant heritability, that was quite likely correct.
The years between fifteen and eighteen were very hard on both her, and the rest of the family. They had her committed a couple of times. She finally ended up joining the Job Corps, which really seemed to suit her. I was never privy to her actual diagnosis, but I believe she was bipolar. She came out of the worst of it, and was doing reasonably well for herself as a young single mother when we lost her to a car accident when she was twenty three.
The point I'm attempting to make is that, in spite of having a good, loving, well disciplined two parent home, sometimes things go wrong. Chances are excellent that you'll never have to go through anything like what I've described above. Maybe it will help give you some perspective on how things could be.