Take half of the coefficient of the second term, and square it
[tex]\begin{gathered} -16\cdot\frac{1}{2}=-8 \\ \\ (-8)^2=64 \end{gathered}[/tex]Add the result to the given to make it a perfect square trinomial and factor it
[tex]x^2-16x+64=(x-8)^2[/tex]