First of all finding a pup out of working stock and seeing the parents work is a must. Never buy a pup that the breeder says is out of working stock without seeing the parents work. The kind of work they do might not be what you want. For instance if you want to drive cattle long distances then find a breeder who has dogs that are bred to do that. If you want a dog to work in the lot then find a breeder that has dogs that do that. Some dogs (usually after A LOT of experience can do one really well and the other just ok. Buying a trained or partially trained dog is usually your best bet the first time.
If you chose to buy a pup and train it yourself the first thing before it ever is around stock is to teach it basic command like whoa, sit, stay, and load up. The dog needs to be able to do all of those on command before ever being around stock or it will have no "brakes" when you tell it to get em. This makes for higher vet bills and more fence work.
I love having a dog to help me work my cattle. I actually have 7 dogs and all of them mind better than a whole bus load of cowboys. I have two that are really rough and only get used when in the lot sorting. I never have to shut the sorting gate. I just tell Jake to sit and if I tell him to stop her she aint getting through the gate. Three of the dogs are really good at getting cattle up. I can take those three dogs and go gather 200 mommas and their babies with no problems. I dont even have to tell them where we are taking them. I just point and they go get them and bring them to me. I drive where I want the cows and the dogs make them follow.
I have one puppy that is still in obedience training, and then one old dog that is only used for bringing my pregnant heifers and their babies up to the barn every day for feeding. I love watching this dog work. Its almost like he can count. If there are 25 heifers and their calves in the field he might bring 22 the first trip and I can send him all the way back (1/4 mile) to get the others and I just tell him he missed 3 heifers and their babies. They all get there.
That dog is 8 years old and will not take hold of a calf. A cow will be bleeding if she doesnt do what he wants, but babies he just pushed with his nose. Every time he gets his job done I give him a treat and take him back to the house. He was my first heeler and it has taken thousands of hours to get his where he is now.
The biggest thing with dogs is not to get frustrated. They are doing what they think you are asking. Usually the problem is in how you are asking.