When you go to select a board, hold one end up to your eye (with the other end still resting on the floor), like the board is an arrow on a bow. Look down the length of the board with one eye, checking to make sure that the board is straight all the way down. Rotate the board to inspect all four sides.
It's important also to make sure your lumber is dry. Kiln dried lumber is a must for outdoor projects like fences and decks. You can also roll a board on the floor to check each side, the same way you see folks testing a billiards stick on a pool table. (Of course the floor needs to be flat)
It's too hard to hold one end of a 2x4 up like an arrow.
I use the flat concrete floor to pick boards. The concrete finishing process includes making sure the concrete is really flat, so why waste it?
If you are picking a board that's displayed vertically and you don't want to pull every board out to check, line it up with the display structure and make sure to turn it 1/4 turn and check again. This will give you a quick estimate before trying to wrangle the board out of the display.
While checking for straightness, check for burns, knots, large cracks, hunks missing, etc. Don't be afraid to get an employee to open another pack for you if you can't find anything you like!
I always dig straight into the middle of a stack. Thats where I find the best boards. Of course I always check them with the arrow method. The fellas at Home Depot smile politely... I try not to make too big of a mess.
If you are getting wood from outdoor storage area:
Best bet is to ask the lumber yard man to help you pick some good straight boards. My experience is they kinda look at you funny, but are willing to help you. I look down like looking down an arrow, and also I pay attention to the knots on the sides.
You get what you pay for. I decided to get the cheapest 2x4's on this last project and ended up with some pretty crappy wood. Pay a little more and it will save you money in the long run. Think about the cost of wood filler, sandpaper and the like, not to mention the time and frustration in throwing away bad pieces!! I learned this the hard way.
When you're first starting out, try each lumber supplier in your area. You'll quickly find that some of them have a lot of scrap wood for new prices. Others will have great wood. Go back to the ones with good wood. Different stores also excel at different products. A store which sells good dimensional lumber might not have good sheet goods. Another store with terrible dimensional lumber could have excellent sheet goods like plywood and MDF.
Another one is to make sure that you get the wood from the same vendor through the entire project. For example, the 1x3's that our local lumberyard had were slightly (almost 1/8") thicker than the ones we got from Big Orange when we ran out on a Sunday afternoon in the middle of the project. We made it look like it was supposed to be that way, but it would have been easier to just make sure we had bought them all from the same vendor.