Picking yarn for a knitter and her project when you have a pattern but know nothing about yarn or knitting can seem daunting but is achievable with careful research and understanding of the project's requirements.
Examine The Pattern
Start by looking at the pattern to understand the type and quantity of yarn required. The pattern usually lists yarn weight (thickness), yardage or skein counts, and the type of yarn needed - wool, cotton, acrylic, etc.
This is from my Love Will Arise sock pattern, we'll use it as the example here.
- Is the weight of the yarn, how thin it is and how much you have length wise per skein. That same info is on the paper wrap of the yarn balls in stores.
- Is the materials the yarn is made of. To make it simple: wool is nice (alpaca or merino is a little bit nicer) and wool blends are more durable, which is nice in socks, makes them last longer. In other garments, not so important.
- Is how many balls of yarn do you need. If the ball in the store weigh more than the suggested yarn, then you are going to need to do some math. If the pattern needs two 50-gram balls, then one 100-gram ball is enough. If you need 3 balls (150 grams) then you need to buy two 100-gram balls. Make sure that the yarn weight stays the same (if the amount in grams doubles, then the amount in yards or meters needs to double too).

Here's the information on a Drops Nepal ball lable. You see it's 75 meters per 50 grams (or 150 meters per 100 grams when you do the math)
Always Buy Extra
It's a smart idea to buy an extra skein of yarn, just in case. It can be used to another project if it's unused, and the knitter will appreciate not running out of yarn in the middle of the project.
By considering these factors, you'll be able to select the appropriate yarn for a knitter's project, even without personal knowledge of knitting or yarn.
If you're unsure, go to a yarn store and they'll help you :) Or get a yarn gift card!