I am trying to only buy yarn for particular patterns, but sometimes the Michael's ads send me drifting off to look at yarn on sale.
They do have those nice printed patterns right in front of various yarns to give you a goal and ensure you're using the right yarn for the right project.
Some days, there I am floating down the aisles, looking at what's on sale and seeing if any colors of the sale yarns appeal to me for perhaps some unknown future project (dangerous territory!). My strategy is now to get three skeins of any new color that hasn't a project assigned, because for many afghan projects, 3 skeins of something will be wanted, and I'm all ready. :)
Here's a handy chart on yarn weights as a further guidance down the road.