f(x) = x^2 - 12x + 7
First, separate the first two terms from the constant
f(x) = (x^2 - 12x) + 7
Next, half the coefficient of second term in the parenthesis (12x) and square the result. Make sure to subtract outside the parenthesis what you added inside so that the equation stays equal.
f(x) = (x^2 - 12x + 36) + 7 - 36
f(x) = (x^2 - 12x + 36) - 29
Now, just factor the trinomial inside the parenthesis, lemme know in a comment if you don't know how to do this and I'll explain.
f(x) = (x(x - 6) -6(x - 6)) - 29
f(x) = (x - 6)^2 - 29
The polynomial is now in vertex form, and the value of a, as you can see, is 6.