When you draw a triangle with vertices A, B, and C, and with the opposite sides labeled a, b, and c, draw an altitude from A to the opposite side a. Call that altitude h. The altitude creates two right triangles. For the leg of the triangle with b as its hypotenuse, we can call that side x. The leg of the other right triangle will then be a-x.
Using the Pythagorean Theorem, the two right triangles have the following relationships:
(a-x)2+h2=c2
h2+x2=b2
Multiply out the first equation to get a2-2ax+x2+h2=c2. Next substitute b2 in for h2+x2 to get the equation a2-2ax+b2=c2.
Now for the triangle with the leg we labeled x, we know cos C=x/b. Solving that equation for x gives us x=b(cos C). We can then substitute that into the last equation to yield a2-2ab(cos C)+b2=c2, or the Law of Cosines:
c2=a2+b2-2ab(cos C)