Many knitters/crocheters use their stash to work on patterns they like. There is nothing wrong with substituting yarn. However, you should consider several issues to have a successful project.
The most important issue to consider is choosing a yarn that has similar characteristics to the yarn used in the main design. If you use worsted weight cotton instead of the worsted weight wool that is used for the original project, you will get a totally different look and feel that you may or may not like. Wool is elastic, cotton is not. This will make a huge difference in the feel of a garment.
The second is the dreaded gauge swatch. If you want to make a garment in one of the sizes mentioned in the pattern, then you have to have the same gauge, or be able to do the math and find out for yourself how many stitches to cast on. To make sure you have the correct gauge, you have to make a large swatch with your intended yarn in the specified pattern for gauge. Make a 6" (15 cm) square and measure the gauge. If you get the same gauge, go on and start working on your project. Otherwise, you should do some more work, change the needle size, work up your own instructions based on your gauge, etc.
If you compare knitting/crochet instructions from a few years ago with instructions provided now, you will find a major difference in the way the amount of yarn needed for the project is defined. In older patterns you will find the amount shown in weight (ounces and grams) whereas today, you will find the amount specified in length (yards and meters), with weight sometimes included. Even on most yarn bands, the yardage is specified. Why the change? When you substitute yarn, weight is little or no help. For instance, one yard of cotton weighs more than one yard of wool, and not all wools weigh the same. This problem has caused a lot of frustration for people substituting yarn. That is why weight has been replaced with yardage in most instructions which will give you a more accurate amount of yarn.
For more information about standard yarn practices, check out yarnstandards.com, the site run by CYCA for standardization of knitting and crochet industry.
Nazanin S. Fard