We have,
z2 – 4z – 12
Coefficient of z2 is unity. So, we add and subtract square of half of coefficient of z.
z2 – 4z – 12 = z2 – 4z + 22 – 22 – 12 [Adding and subtracting 22]
= (z – 2)2 – 42 (Completing the square)
By using the formula (a2 – b2) = (a+b) (a-b)
= (z – 2 + 4) (z – 2 – 4)
= (z – 6) (z + 2)