Firm boundaries and appropriate and consistent sanctions from an early age. If you cannot 'control' a four year old there is no point trying to put boundaries in at 11.
Then, really listen, praise often, spend time with them, chat to them, observe them. Support them if they are in the right, do not support them if they are in the wrong, explain to them calmly why you can't support them. Encourage personal responsibility, promote education and instil (by example) a good work ethic. Show them that they are loved for who they are, give them security and stability. A home with laughter and fun in it.
Parent them, don't pander.
I have four sons and one daughter ranging from 36 to 23. All of them have professional jobs and good degrees. However, more importantly, they are all kind, thoughtful and self-aware.
Two or three instances of unacceptable behaviour stand out in their growing up.
One - a lady knocked on my door and said my 11 year old had used bad language to her. We don't tolerate that in our home and he hadn't learned it from us. I spoke to him about and he shamefacedly admitted it was true as she had shouted at him in front of his friends (quite aggressively apparently) to stop pulling at bushes as he was looking for his football. I didn't in any way condone it or make excuses.
I had her address and I made him take all his pocket money, go to the local florist and buy flowers and then I took him and his friends to her house and sent him to make a grovelling apology whilst his friends listened in. He is 36 now and he still talks about that incident and how it taught him a lesson in personal responsibility that he has never forgotten.
In all the instances I have dealt with over the years I have listened, assessed, made a decision on how to proceed, communicated that decision calmly with an explanation of why, and then followed it through. We began this process from a very early age and were consistent in approach.
On a couple of occasions when they had detention slips for 30 mins I asked for that to be increased to an hour reinforce the fact that we backed the school and to send that message loud and clear.
It is much, much, easier to stand back and go with the flow, but like with everything, you do reap what you sow.
Start early would be my advice.