Let $Ax + By + C = 0$ be a general equation of a line and $x\cos \alpha + y\sin \alpha - p = 0$ be the normal form of the equation.
Then,
$${-p\over C } = { \cos \alpha\over A} = { \sin\alpha\over B}\tag{1}$$ $${p\over C } = { \cos \alpha\over -A} = { \sin\alpha\over -B} \tag{2}$$ $${p\over C } = { \cos \alpha\over -A} = { \sin\alpha\over -B} = {\sqrt{\sin^2 \alpha + \cos^2 \alpha}\over \sqrt{A^2 + B^2}} = {1\over \sqrt{A^2 + B^2}} \tag{3}$$
$$\therefore \bbox[ #FFFDD0, 10px, Border:2px solid #DC143C]{p = {C\over \sqrt{A^2 + B^2}}, \cos \alpha = {-A\over \sqrt{A^2 + B^2}},\sin\alpha = {-B\over \sqrt{A^2 + B^2}}} $$
I did not get the $(3)$ part. Where does $\displaystyle{\sqrt{\sin^2 \alpha + \cos^2 \alpha}\over \sqrt{A^2 + B^2}}$ come from ?
I'd do it differently: since $A$ and $B$ are not both zero, we can divide by $-\sqrt{A^2+B^2}$, getting $$ \frac{-A}{\sqrt{A^2+B^2}}x+\frac{-B}{\sqrt{A^2+B^2}}-\frac{C}{\sqrt{A^2+B^2}}=0 $$ and we can choose $\alpha$ so that $$ \begin{cases} \cos\alpha=-\dfrac{A}{\sqrt{A^2+B^2}}\\[6px] \sin\alpha=-\dfrac{B}{\sqrt{A^2+B^2}} \end{cases} $$ and set $$ p=\frac{C}{\sqrt{A^2+B^2}} $$
For the mysterious formula, observe that, if $$ k=\frac{\cos\alpha}{-A}=\frac{\sin\alpha}{-B} $$ then $$ A^2k^2=\cos^2\alpha,\quad B^2k^2=\sin^2\alpha $$ so also $$ (A^2+B^2)k^2=1 $$ and $$ |k|=\frac{1}{\sqrt{A^2+B^2}} $$ Of course one needs to be very precise about the choice of $p$, using this method. It is implied that $p<0$ if $C<0$ and $p>0$ if $C>0$; a special case should be made when $C=0$.
The method above is independent of these considerations.