Hi! this truely is too complicated.
The 50 g or 100g is just the weight of the skein / ball you got. That means you have 2 times as much as recommended.
Patterns usually say how many skeins you need. That is why patterns that may use 20 g really, say they need 50 g, if they use 70 g they may say "100g" (since the writer assumes you buy complete skeins / balls).
So, what we mean by weight of the yarn and the relevance for the pattern, is more the ratio between weight and lenght.
Imagine a thick yarn: a piece of a certain length is much heavier than with a very thin yarn. (in extreme: ship ropes and sewing thread).
Also: in 50 g of yarn (or 100 g if you buy a bigger skein) there are less meters or yards.
You have to know how many yards there are so that you can find out how much yarn you need to buy.
What you have to really compare (now that you have a pattern) is the stitch ratio (it usually says on the wrapper of the yarn. (e.g. 20 stitches 24 rows (on a swatch of 4 inches by 4 inches or 10 cm by 10cm // or maybe 10 stitches and 12 rows on the same swatch...).
If you do not know, you make a swatch. Knit up a piece that is approx bigger than 4 by 4 inches and count how many stitches and rows you have within 4 by 4 inches (there are a lot of threads here about that). Ask if you have any questions.
changing the needle size will make your knitting bigger or smaller so you can partially adjust the number of stitches and rows (but not infintely of course.)
So, maybe you can link the pattern? And maybe you can even tell us the brand and type of that yarn? if so, we can be incredibly more helpful