We need a perfect square, and we start with
[tex] x^2+12x [/tex]
This means that the binomial begins with [tex] (x+\ldots)^2 [/tex], and [tex] 12x [/tex] is the double product of [tex] x [/tex] and the number we're looking for. So, that number is [tex] 6 [/tex]. Since
[tex] (x-6)^2 = x^2-12x+36 [/tex]
we need to add [tex] 30 [/tex] (and subtract it to leave the expression untouched. So, we have
[tex] x^2-12x+6 = x^2-12x+6 + 30 - 30 = (x-6)^2 - 30 [/tex]