Oftentimes, when knitting, you will be required to join in a new ball of yarn. There are several ways to accomplish this and it will depend on your preference, the project, and your skill level.
Ideally you will join a new ball of yarn at the end of a row to make the join appear less obvious.
Knit your first stitch with the new ball of yarn using a slip knot, same as you would to knit your first stitch to cast on. Insert your needle under the fist stitch, like how you would to purl stitch. Then, rather than wrap your working yarn around your right needle, thread the stitch created by the slip knot into your right needle to create the first stitch of the new row.
The magic knot is much stronger than the simple knot and works well with garter stitch projects. Hopeful Honey has a beautiful video showing exactly how to create the magic knot. The end result is a neat and tiny knot that will not come apart.
Joining yarn without creating a knot can be done by weaving in the ends of the yarn. Drop the old strand of yarn, leaving a tail of approximately 15-20 cm. Pick up the new yarn and continue knitting. At the end of the project, you will weave the loose ends back into your work.
If you want a completely seamless and invisible join, wet felting may work for you. Take the ends of both the old yarn and the new yarn and tease it out a bit so that it is fan shaped. Remove excess yarn fibers so that the two ends are flat, not fluffy. Dip each end in a glass of water, overlap the two ends, and rub the yarn ends together. The friction created by the rubbing will merge, or felt, the two ends together. Use a paper towel to dab off excess water and continue to knit with the joined strand.
Similar to weaving in ends, alternate stitching is a fairly seamless way to join two balls of yarn. As you reach the end of the old ball of yarn, begin to alternate stitches with the new ball of yarn. The end result is a secure and invisible join. Remember to bring the old working yarn up above the new yarn to prevent the two yarns from twisting. When you come to the end of the project, weave the loose ends back in.
With each project, evaluate which method of joining will work best for your application. It is recommended that new knitters practice a few different joining methods so that they are ready during their project.