The square of a binomial is written like
[tex](x\pm a)^2 = x^2\pm 2ax + a^2[/tex]
In your case, you have [tex]2ax=-8x[/tex], which implies [tex]a=-4[/tex]
So, we want to write
[tex](x-4)^2 = x^2-8x+16[/tex]
But our left hand side is
[tex]x^2-8x-10[/tex]
If we add 26 to both sides, we have
[tex] x^2 - 8x - 10 +26 = 18+26 \iff x^2-8x+16=44 \iff (x-4)^2=44[/tex]