(As with anything else I write about parenting, this is mostly just my observations with my own two kids and may not generalize as well as I think it does.)
A few weeks ago I wrote about why I think it's valuable for parents to be predictable. I was mostly describing an end state, though, and reasons why it's a good place to be, but what should you do if you're interested in being more consistent?
I think it breaks down into three pretty different skills. The first is only saying things you're comfortable fully standing behind. Many people especially when irritable, sleep deprived, or surprised, can quickly spit out a consequence that is harsher than is fair. Things like, "if you don't stop this minute it's no desserts for a week!" Then when the threat fails the consequence feels too extreme, and they don't follow through. If someone read my earlier post and decided they needed to stand by their quickly distributed threats I'd be pretty sad, and not expect this to make things better. Instead, any consequences need to be reasonable and proportionate, where you feel fair when you do have to enforce them (which, ideally, is rarely).
One thing that can be helpful is having a system of simple stock responses. The simplest is just a stern voice. If you reserve speaking firmly for rare circumstances, then saying something intensely and seriously can feel very significant.
Time outs can also work well: we use a system where we make it clear what needs to change ("stop shouting", "brush your teeth"), count to three, slowly and clearly, stopping if they do what we want, and if we get to three then it's time out. Serious things can be time out immediately. If you reliably use these, then not only does the kid understand how they work and what they mean but you don't have to come up with a novel appropriate response at a time when you're very stressed ("Do not bite me. That's time out.)
Even better, though, is avoiding commands and threats entirely. If they've been playing with a puzzle and they ask you to read to them, you can say you'll read once they clean up the puzzle (and depending on age maybe help them clean it up). They probably want you to read badly enough that they clean up, but if not that's ok too. You're using something they want you to do as leverage to get them do something they should do, but you're also teaching them the general practice of cleaning up one thing before getting out another.
Similarly, don't make committments unnecessarily. Instead of "I'll go downstairs and get your bear" maybe "I'll go downstairs and look for your bear." While with adults we understand that when a person says they'll do something they mean they'll put in a reasonable effort and may fail if the task is surprisingly difficult or if factors outside their control intervene, I find that with kids being explicit about likely failure possibilities is helpful. "I'll go see if we have any more cheese sticks." Similarly, adults understand that you don't have authority over everyone around you, but with kids phrasing like "Mama can read to you when we get home" isn't as good as "I'll ask Mama if she'll read to you when we get home." Or, even better, "when we get home you can ask Mama if she'll read to you." 
The next skill is thinking of rules that will work well in a range of situations. These can be explicit rules ("hold hands when crossing the street) or implicit ones (saying yes/no without explaining reasoning but following a pattern you could explain if asked). I find thinking "saying yes/no no means saying the same thing in this sort of situation in general" is a helpful way of thinking about it. 
This is another case where preparation can help. Before going to the beach, think about what rule you'll have for the water: "stay with a grown up the whole time", "only go in the water with a grown up", "only go in the water by yourself right in front of the lifeguard." If you notice yourself giving inconsistent answers to questions, take some time later to figure out if there's a rule that would work better ("one short video each night, after dinner"). It's ok, and expected, to end up with a rule that doesn't match some of your previous decisions, just try to get a rule you'll be happy with. ("I know we did let you stand on the table sometimes, but from now on there's no standing on the table.")
The easiest rules to be consistent with are the ones our culture has for adults, since you and everyone else more or less know what these are. As kids are generaly less capable, tall, intelligent, prudent, etc than the people these rules have evolved for, you are going to need to make accomodations. But I find that starting with a perspective of treating kids like adults unless there is a reason otherwise works well.
The third skill is actually following through on things you've said. The better you get at the two skills above the easier this is: you're saying fewer things that need to be backed up, the consequences you've promised are ones that generally seem fair, and your kids generally understand the patterns and choose to avoid the consequences. But they will still test to see if maybe the boundary has retracted while they weren't looking, and when they do you need to be firm. Sometimes this is unpleasant for both of you but it makes the rest of your interactions far better. 
(One way that poverty is harmful, and that parenting while well off is unfairly easy, is that external factors can keep you from being reliable for your kids. If I tell them I will do something I have enough control that I can make sure it happens, but if I had work with less flexibility, less money, or generally less slack this would be much harder. Similarly, it's much harder to be predictable when you're tired, hungry, overworked, or otherwise not at your best. If I tell my kid no and they decide to test me by tantruming, I'm going to be able to be stubborn longer than they can. But I'm only able to be in a good mental state for that because I've been lucky in how well my life has gone.)
Cross posted from jefftk.com.
 The first version, "Mama can read to you when we get home," has a different downside which is that one parent is making a promise on behalf of another. We try very hard not to do this, and being careful about it generally makes our interactions a lot better.
 This is also useful for yourself. Instead of "do I want to skip exercising this morning because I'm sleepy" it works better to ask "do I want to skip exercising every morning where I'm this sleepy." Sometimes the answer is yes, often it's no, but it's much more likely to be a decision that looking back you'll think was the right one for you to make.
 I've phrased this as about verbal consistency, but it works even when the kid is too young for words. Sleep training, for example, generally needs a bunch of thinking "I know they're really sad right now and short term would like a cuddle, but we will both be much happier long term if they learn how to sleep on their own."
This is an under-appreciated facet of leadership and authority positions in general, but I like it especially well because I am a new parent. Sleep training beginning this week, in fact.