It's a value you should probably memorize:
[tex]\cos45^\circ=\dfrac{\sqrt2}2=\dfrac1{\sqrt2}[/tex]
You can derive it using some trigonometric identities, other known values of cosine, and properties of the cosine function. For example, using the double angle identity for cosine:
[tex]\cos^2x=\dfrac{1+\cos2x}2[/tex]
If [tex]x=45^\circ[/tex], then
[tex]\cos^245^\circ=\dfrac{1+\cos90^\circ}2[/tex]
and you probably know that [tex]\cos90^\circ=0[/tex], so
[tex]\cos^245^\circ=\dfrac12[/tex]
When we take the square root, we should take the positive root because [tex]\cos x>0[/tex] whenever [tex]0^\circ<x<90^\circ[/tex]:
[tex]\cos45^\circ=+\sqrt{\dfrac12}\implies\cos45^\circ=\dfrac1{\sqrt2}[/tex]