When you purchase your lumber it is very important to check for any defects. There are a few major things to check right away and if you're purchasing lumber form the big box stores, they will almost always have many defect to be aware of. Your job is to pick the best of the worst.
-Bow. The first thing I always check is for a bow. If you hold the board edge up toward your eye, you can see if the wood is bowing to one side or the other. Most dimensional lumber has some bow to it but you want to find the piece that is as straight as possible. If you're purchasing hardwood from a good dealer you wont have to worry too much about this. If you're building something that has to be square then you can't have any bow to the lumber as it will be very difficult to get it square.
-Cup. If you hold the wood with the front down and bring it up to your eye, you can see if the wood is cupped. If you're making a cutting board, for example, you can't have too much cup to the lumber. It will take a lot of work after gluing the lumber up to get the board straight and true. This is important to make sure there's not much cup.
-Knots. Most cheaper lumber, such as common pine, will have tons of knots in the lumber. This is unavoidable. You have to purchase better quality lumber, such as poplar, to get lumber that is knot-free. If you do buy common pine, give the knots a tap with your finger to make sure they don't fall right out. When you cut the lumber try not to cut through the knot because the rest of it will most likely fall out. If the knot is tight it shouldn't cause an issue.
-Splits. Take a look at entire board especially on the edges to make sure there's not splits or cracks. This can be a problem when you're trying to screw the board to something. If there's already a split and you put a nail or screw into the split or crack, the board could break in half.
-Twist. You have to make sure the board is not twisted. You will most likely see this when you check for bows. The board will look like it's twisting, like a towel. This is another thing that will cause you issues depending on your project.
There are other problems your board can have but these are the basic problems you need to look for that could cause issues in your project. When you go to the lumber rack you will see a bunch of boards thrown to the front of the pile. Those are usually the ones people have gone through and are junk and they throw them to the front (I am guilty of this). So before you go and quickly grab a piece of lumber and run out the store, save yourself some headache and look over the lumber first. Your project will thank you.