When I first learned to knit the Internet didn't exist. Pattern support meant that the yarns in your LYS had one or two patterns written specifically for that yarn but often there were great older patterns in the store that did not have the corresponding yarn in stock. I often couldn't afford the suggested yarns even if they were in the store. Yarn substitution has now been made easy with resources like Ravelry and most Knitters buy yarn and patterns independent of one another.
If the yarn of your chosen pattern is not available, is too expensive, doesn't come in a colour you like, is too scratchy or is a gift for someone who won't hand wash it carefully......or you have any other reason for using a different yarn you can easily find an appropriate replacement.
Assuming that you want to closely mimic the original designers yarn choice the rule for yarn changes are to pick an yarn that knits to the same gauge. Next you should consider the fiber, knitting a pattern with many cables in cotton when wool was used originally could result in a garment that stretches with its own weight long past the hem length on the original pattern. It's generally a good idea to stay in the same category of yarn, for example animal versus plant based fibers until you are more knowledgeable about knitting but if allergies are prompting the substitution ask more experienced knitters for their input. Within these categories you still need to proceed with caution as only a swatch will tell you exactly what you are getting. Unfortunately if you don't have access to the original yarn it's always a guessing game. Checking that the needle size of both the original and the intended yarn is similar is often a good point of comparison as well. You can knit fuzzy mohair and a smooth wool on different size needles and get the same gauge but a totally different fabric will result. Substituting a different yarn can also result in a much improved result from the original design. I know of one case where a magazine changed the yarn due to editorial reasoning and that resulted in a garment no where near as beautiful as the original designers sample. Another designer told me that one of her garments was published with a different yarn credit as the original yarn had been discontinued. Once she sold the pattern rights she had no control over what the publication did. So what you see on the pattern may not be accurate.
Even yarn that has the same gauge and the same fiber content can vary widely in the resulting fabric after being knit. How the yarn was processed, spun and the knitting technique of the individual knitting it can impact the result. I just finished two hats both out of sock yarns knit on the same needles yet one hat appears to have a different row gauge. This was especially surprising as I also knit two neck warmers from the same two yarns that appear to be exactly the same size.
Much of a knitters knowledge of yarn substitution comes from years of knitting with different yarns and is a result of that long experience. Knitting a large swatch is a good way for you to verify that your yarn choice is appropriate for the pattern and in many cases may be better than the original yarn.
Using the Ravelry advanced yarn search http://www.ravelry.com/yarns/search?advanced=1 allows you to do your search in so many different ways. To find yarns similar to Cascade 220 I searched by weight (12 weights) and fiber (25 categories) and found 1100 possible matches. After checking the buying options for a few I could easily go to my LYS or order an appropriate yarn on line. WOW what an amazing resource!