99% of the time, if things go wrong it's YOUR fault!
Of all the sheepdog training videos and DVDs I've watched, this is the single most important statement I've gleaned.
It was said by Martin Penfold on the Rural Route video "Starting Border Collies on Cattle, Sheep or Ducks" I think Martin actually said 90% of the time, so I hope he'll forgive me for increasing the odds. (I should add here that I approve of most of the methods used in that video, but not Martin's method of teaching the dog to lie down).
Quite frankly, if your dog's not doing what you want, it's because you're asking him to do things he's not ready to do or he doesn't understand what you want of him.
So if you feel your anger building up, give the dog some really easy tasks and make sure your voice is normal or possibly even a little softer and friendlier than usual.
If these easy tasks go wrong, don't shout and bawl at the dog, go home and mow the lawn, it'll be more constructive. If things go well however, you can gradually build back up to the level of work you expected before you started getting cross!