I liked Jubee's examples.
I think the one thing we often forget is that we, as parents, are our child's first and hopefully best models. So, with this in mind, I try to model the behavior I want to see. That's the first step, from my perspective.
Making expectations clear is also important. When my son was about three, we'd be at a restaurant and he'd say "I want to run" and want to get out of his seat. If it was convenient, I'd offer to take him outside, however, I always talked about what the potential consequences of his proposed actions would be "well, if you did run, what could happen?" ("I'd run into the server; I could bump into someone" etc.) We tried to make him aware of potential negative consequences before he did something.
I also believe in giving "how" choices when a child needs to do something. Little kids often hate to break off what they are doing to go use the bathroom or come to lunch, etc. so I employ a "do you want to fly like a bird (flapping arms) or be like a motorcycle (pantomiming again) to the table?" The "how" choice often moves their brains past "am I going to do what is asked" to "HOW am I going to do what is asked?"
Of course, as kids get older, we expect more self-regulation and cooperation, and this is where I try to use thankful feedback ("Thanks for coming right to the table when I called. I'm so happy to get to enjoy lunch with you") and then also make my son aware of the consequences for non-compliance *before* things escalate. I would also suggest reading "How to Talk So Kids Will Listen... and How To Listen So Kids Will Talk" to encourage further good communication and positive problem-solving. Both kids and adults need to feel heard by each other. To me, this also creates positive situations where older kids can give us feedback about what aspect of a task or direction/rule is hard for them and even if we can't fix it, when they feel listened to and understood, we connect with them. And that is a very, very positive thing!