The truth is we all know really good parents who have children who have gone really off track. I think we look at those parents and we think "Oh God if they can't get it right who can?" . Then there's those parents you might view as less than stellar and their children grow up spectacularly. It's easy to wonder if there's even a pattern to all this or if it's just dumb luck.
One of the most important aspects of being a "good parent" with a "good kid" is to model good qualities and behaviors. Be the people you hope they emulate. This article has some great tips. They seem stupid simple, but I've found that's usually where the most true answers are in life; hiding in plain sight The actions that make you a better and more balanced person are what are going to help you kid along too.
Remember that parenting is hard, it's the hardest job there is. Everyone is trying to figure it out. Be kind to your fellow parents, and be kind to yourself, and maybe, just maybe your children will see that kindness and reflect it back to others.