$\cos(\arcsin(x)) = \sqrt{1 - x^2}$. How? How does that bit work?
How is
$$\cos(\arcsin(x)) = \sin(\arccos(x)) = \sqrt{1 - x^2}$$

You know that "$\textrm{cosine} = \frac{\textrm{adjacent}}{\textrm{hypotenuse}}$" (so the cosine of an angle is the adjacent side over the hypotenuse), so now you have to imagine that your angle is $y = \arcsin x$. Since "$\textrm{sine} = \frac{\textrm{opposite}}{\textrm{hypotenuse}}$", and we have $\sin y = x/1$, draw a right triangle with a hypotenuse of length $1$ and adjacent side to your angle $y$ with length $x$. Then, use the pythagorean theorem to see that the other side must have length $\sqrt{1 - x^2}$. Once you have that, use the picture to deduce
$$
\cos y = \cos\left(\arcsin x\right) = \sqrt{1 -x^2}.
$$
Here's a picture of the scenario:

