The vectors $x$, $y$, and $x-y$ form a triangle with vertices at the origin, the endpoint of $x$, and the endpoint of $y$. The law of cosines says that for any triangle with sides of length $a$, $b$, and $c$, $c^2 = a^2+b^2 - 2ab\cos(\theta),$ where $\theta$ is the angle opposite the side $c$.
Apply the Law of cosines to the angle formed between $x$ and $y$ at the origin. The lengths of the sides that form that angle are precisely $\lVert x\rVert$ and $\lVert y\rVert$. So from the law of cosines you would have $\lVert x-y\rVert^2 = \lVert x\rVert^2 + \lVert y\rVert^2 - 2\lVert x\rVert\,\lVert y\rVert\cos\theta.$
Now use the fact that $\lVert x-y\rVert^2 = \langle x-y,x-y\rangle,\quad \lVert x\rVert^2 = \langle x,x\rangle,\quad\text{and}\quad \lVert y\rVert^2 = \langle y,y\rangle.$ Expand $\langle x-y,x-y\rangle$, and simplify.