I think the first consideration is your budget. There are wonderful yarns out there, but some are so expensive, you have to take that into consideration.
Things to look for when choosing a yarn for a pattern are the weight of the yarn--worsted, sport, dk, fingering, etc. That will give you a starting point as to what yarns to look at. If you see a pattern that calls for one brand of yarn, but you want to use a different brand, check the yardage on both brands to make sure you get the right amount.
Then there is the yarn content to consider--acrylic, blends, wool, alpaca, angora, cashmere, silk, cotton, etc. I threw cashmere and angora in there because that's as close as I'm going to get, I think.
Your best bet is to go to a yarn shop with a variety of yarns and touch.
Washability is a major factor, too.