What happens when I run out of yarn?
Whenever possible, avoid running out of yarn in the middle of a row. You need 3.5-4 times the width of the finished row in yarn length to make it all the way across. If you do not have that much yarn remaining, change yarn on the edge of your row.
If you run out partway through, you should “unknit” back to the beginning so you can change skeins properly. “Unknitting” is what I call putting the previous row’s stitches back on the left needle and letting the new stitches drop. There are other ways to handle this, but as a beginner, this is the best way to ensure that your finished work is neat and tidy.
NEVER knot your yarn. At the edge of a row it can cause puckering, and in the middle of a row it will always work its way to the right side of your work and look unseemly. If you need to provide slight resistance on the edge of the row when starting with a new skein, give it a single twist (a half a knot), and then untwist it when finishing so you can weave the ends in properly.
There are many brilliant methods of splicing yarn or weaving ends together that knitters have invented over the millennia. You will want to explore these as your skill improves (search “yarn joins”), but for now, go by this rule of thumb: change yarns at the beginning of a row on pieces knit flat*, and never knot your yarn.
*Once you begin knitting pieces in the round, you will need to explore other methods of introducing new skeins, so that Internet search will come in handy.