Another fantastic tip that I picked up is not just to announce an immediate instruction to your child, such as bedtime or leaving a friend's/relatives house
Give them twenty minutes notice, then 15, then 10, then five, then a couple
It makes getting them to co operate far easier