I am in the UK and buy, use, and deign with yarn bought in the UK, you (for all I know) are on Mars and can not gain access to the same yarns as I can. This can lead to difficulty, confusion, and reluctance to buy a pattern (I have seen requests from people asking for a pattern in green, you can use any colour you want, promise). Using a different yarn is not as complicated as it first seems there are a few things to help.
If the recommended yarn for a pattern is 100% wool you don’t want to stray too far away from wool as different fibres weigh different so the drape and hang of a garment will be different.
50g of a 100% wool yarn will have about 116 meters length
50g of a 100% acrylic yarn will have 140 meters
so the wool weighs more and will hang heavier.
I am talking about DK vs worsted vs 4ply vs fingering here.
I have to admit this method of identifying yarn is a bit hit and miss, I much prefer WPI (wraps per inch) myself but if that information is not available what do you do?
Have a look at the yarn band
You see the square with 10 cm written in it? that tells you that with this yarn on 3mm knitting needles you should get 22 stitches and 24 rows, this is a little subjective but it is a starting point. If the recommended yarn states 22 X 24 then that is ideally what you are looking at in a substitute.
Some yarn, King Cole Riot for example are officially DK but act like lighter yarn, King Cole Riot for example on 4mm needles they say you would get 22 stitches and 28 rows and I have found that it has a lot of “halo” so to make a dense fabric it would need to be treated as a 4ply.
and this brings us to
If a yarn is designed to be fluffy and have a large “halo” it will create a light airy fabric, you will not get this with a yarn designed to be self contained. In this matter there is no substitute for experience, but while you are getting to know the yarns readily available to you, going to your LYS (local yarn shop), touching yarn, rubbing yarn, sniffing yarn (what? there is no law against it, and wool smells GOOOOOD), Ravelry has an extensive yarn database that is updated all the time and has pattern suggestions attached so you can see the types of projects and compare them to the pattern you would like to make.
Sorry, but there really is no substitute. Asking at your LYS is always a good way to go, I know there are stories of LYS employees/owners not having the first clue about yarn (and the inevitable “oh, it’s for crochet) but really, a good LYS will have at least one sane and sensible person there, I mean how many yarn crafters would not want to work in a LYS and get a staff discount?
Another option is Ravelry (again), extra helpful if the pattern you would like to follow is in the database as people will have made the item with different yarns so you can get an idea at yarns to look at.
Asking the designer is also a good idea, they, after all, know what the recommended yarn feels like.
If in doubt try it, buy one skein of the yarn you would like to use and work up a swatch, get gauge, and see how it looks (rub and sniff it again if you like). You’ll learn more about yarns as you use more varieties, run with it, have fun, and remember
it’s not frogging it’s recycling yarn.