Cattle yards can be as a different as different types of farms. In a perfect world, the gates would all swing smoothly and the fences would all be A1. You don't have to do it for long, however, till you discover that the world is not perfect and neither are yards. You just have to adapt to what you have.
Your best resource for making cattle do what you want is your demeanour. Cattle will be almost exactly as calm as you are, and how calm they are sets up how hard your job will be. It's best to look like you're confident and in control.
The second best resource you have is your voice. Cattle respond to sound more than anyting else. Everyone finds a different 'phrase' that they can best use and modify. The old boy tends to use "har-arr" and "heddup". Little sister tends to whistle (I'm not convinced that this is effective). I use "Hup-pup". It can be sped up if you're walking briskly behind livestock and you want them to move faster ("hupupupupup"). When you're not sure you can stop them doubling back through a gateway you're standing in, the phrase can be lengthened in a soothing tone that seems to hold ther attention ("Huuuuuuup-puuuuuuup"). The first syllable can can also be shouted to try and budge an animal that is standing stock still in a race or crush: sometimes shouting "HARP-a!" is enough.
The least important tool must be a stick, or 'waddy'. We've always used pieces of PVC pipe about 4 feet long: they're too light to do any real harm to cattle (which is why using an actual stick is a bad idea) and are good enough for what you're likely to need to do.
A waddy should chiefly be used to communicate with the beast and let it know where you want it to go. As a rule, a tap on the rump will make it move forward. A tap on the flank will make it turn, and (mostly) a tap on the muzzle will make it go backwards if your voice won't. These taps don't need to be hard: imagine that you wanted to roll a peach from its base to its side and do no more than slightly dent it and you'll have the idea.
There's really only one time that you need to hit hard with a stick. Sometimes an animal will balk and for some reason not want to move into a race or a gateway. Usually a single stinging blow on the rump will be enough to get them moving again. Imagine (again) that you were hitting a peach, and that your blow will pretty well smash one half of it but leave the other fit for eating. You should never need to do this more than twice with any one beast while working with them
The other exception if where an animal is 'stirry', and can't be made to go smoothly through the yards. This can be a problem because an animal like that will tend to stir up the others. In this case, it's necessary to show the animal who's boss. A couple of ferocious whacks will usually do the trick (continuing the idea before, in this scenario the peach you're hitting has been reduced to a heap of pulpy fragments). You will get a 'stirry' beast every so often (Red Poll cattle seem especially prone to be this way); if you're having one every single time, recheck how you're handling them from the start.
The biggest challenge is with 'mad' cattle. I don't know if there's any research into whether bovines ever suffer from mental illness or hypoxic brain damage or concussion. That fact is, however, that some animals react erratically and irrationally to being in yards, seek to jump every fence and have no qualms about going over the top of their handlers. With these, your best asset is a calming voice: imagine that you're trying to soothe a crying baby without touching it. often walking towards them making this sound will be enough to make them go where you want. Shouting at them or hitting them with a stick is the worst thing you can do: it will only make them even more erratic and energetic. There is one exception to this, and that is if you see them preparing to jump a fence or a gate (usually by stopping or slowing right down and then placing much of their weight on their back legs). If you tap them on the nose before they can commence the jump, they'll balk and their weight will go back on their front legs again. The time they take to prepare for a second jump is your chance to re-assert control of the situation.
What I've said so far is all sound for working with cows, heifers and steers. Bulls are a slightly different matter. I have found that bulls in most of the regular beef breeds are actually more placid than cows. However, they're also less inclined to move just because the rest of the herd is moving. They also need to be 'persuaded' to do what you want them to do. This means your demeanour has to be confident and in control. Sometimes it can be fun to see if they react if you paw the ground the way one bull does when challenging another (they'll usually eye you more seriously), but this isn;t the place to do it: your authority should not be in question. Your tone of voice should be assertive but not loud and fierce (imagine you're trying to escort a drunk friend out of a pub and you'll have it). As a rule you should only need to use a stick to help steer the animal: If a bull turns on you and wants to do you harm, a stick will not deter him. One word: run.
Do you work with livestock? What do you find works best when handlng animals?