The expression x^2-16x+64 factors to (x-8)^2. We can see this by FOILing out (x-8)^2 = (x-8)(x-8) to get x^2-8x-8x+64 = x^2-16x+64. You can also use the box method as shown in the diagram below. The box method is a visual way to keep track of the terms. Each cell in the table is the result of multiplying the outer values. Example: the value 64 in row2,column2 is the result of 8*8 = 64. So this shows why 8 goes in the first answer box.
The 64 in the second answer box is from the 64 from step 3. It gets transferred/copied down to step 4.