I think you may find it comes as the child grows up.
It;s hard to imagine parenting a child now because the child isn't here - which means you don't know what you are going to get!
My dd is 3. She is strong-willed, independent and stubborn to the point of insanity. Things I've done with other people's kids for ages don't work so well with her. The worst so far is the refusal to come with me when we're out. You know that old "Goodbye then, if you don't want to come, I'm going" coupled with pretending to walk off? Fails miserably - she just says, very cheerily, "Ok Mummy, see you soon". I've even hidden, for twenty minutes, waiting for her to be upset and spooked into coming after me. She wasn't.
I didn't know this until she got to this stage so I'm thinking on my feet, as it were!
Our general principles are:
Not too many rules. So we think hard before we say no to something. Is it something we are prepared to dig in and fight over? If no, don't say no in the first place. That way, we don't spend all our time at home saying no.
She gets reasons for things, most of the time. Not long, drawn out reasons, and not ones she can argue with, but so she knows why. "Can I have some chocolate?" "No, because we are going to eat dinner soon." "I don't want dinner." "That's fine. But you're not having any chocolate either."
If she gets irrationally upset at something, even if it's something we said no to, I will sit on the floor and ask her why she's so upset. It does not mean I back down and give it to her, but I like her to try and explain to me - my thinking is it gives her the chance to think about and explain her feelings. It doesn't change the fact that I am in charge of the situation, but it does give her a chance to be heard.
There are lots of things we don't punish for that would be classed as bad behaviour - we just deal with them differently. She's not allowed to get down from the table until we have all finished eating (or we say she can). If she does, she's not allowed to come back for pudding. She knows that now (and yes, we have sat in front of her eating pudding with her watching every mouthful with her saying "but I am sitting down now"). Mostly, she doesn't get down without asking! If she's asked and we've said yes, then she can come back when we're ready for pudding - we don't make her sit there for hours if we are faffing!
We make it up a bit! We had major issues recently with her running off in public places, so we bought reins. We told her we'd put them on her every time she ran off. We had to do it twice. I still carry them with me, and all I have to do I show her and say "Do you want these on?" and she stops.
We do our own version of time out - we call it sitting by yourself. She dislikes it, so it works. She gets a warning "If you do that again, you'll be sitting all by yourself" so she knows full well what to expect if she carries on. I do it anywhere - on a beach, in a shop - and once I've threatened it, it's always carried out if she continues what she's doing. She hates being away from the action, which is why it works for us. Deliberately hitting/kicking with intention to hurt get no warning - do that once, and you're out.
Interestingly, even at 3, she's got a strong sense of fairness. If I sit her on her own and she knows she's been naughty, she will be very contrite and apologise and very rarely return to the naughty behaviour. If she thinks I've been unfair, she sobs and shouts at me.
We found consistency to be by far the best thing.
Same rules wherever you are so they know what is expected.
Always follow through - when you say you will do something, whether good or bad, do it.
And avert where possible - if you're going out for a coffee or for lunch, take stuff with you (colouring etc) so they have stuff to do. Don't go out ten minutes before lunch time, or when they are due a nap. If you must, pack up a picnic or have somewhere they can sleep. Don't leave a bottle of sunblock on a coffee table unless you want your coffee table 'polished' in sun cream!
They will always do things that take you by surprise so don't think you can plan ahead for every situation, but you'll be surprised by how much just seems to fall into place as your child grows.