To change color, wheteher it is at the beginning, at the end or right in the middle of a row, it’s very simple : you just have to finish the last stitch of color A by pulling a loop from color B.
It may be difficult for a beginner to hold every strand of yarn so if it’s easier to you you can tie a knot with the yarn ends, but know that it will create an irregularity on the side of your work.
The last step is to weave in ends with a yarn or tapestry needle (whichever is big enough for your yarn), or, if you want to save time , weave ends on the go :