The Law of Cosines is used to find an unknown angle or an unknown side in a non-right triangle.
It's purpose is to solve triangles for which there isn't enough information to use the Law of Sines.
The Law of Cosines allows us to solve triangles where we don't have '3 out of the 4' pieces of information needed.
Looking at the Law of Cosines, you may note that it seems to be related to the Pythagorean Theorem.
Starting with a non-right triangle
First, drop an altitude down from angle B:
This splits the triangle into two separate right triangles
Once we have right triangles, we can use both the Pythagorean Theorem and Right Angle Trigonometry.
We have now created two right triangles and have expressions for each one. We can now use the Pythagorean Theorem to solve for an unknown side length.