Whenever a quadratic equation is in the form
[tex] x^2-sx+p [/tex]
(i.e. the leading terms is 1), you can solve it by looking for two numbers that give [tex] s [/tex] when summed and [tex] p [/tex] when multiplied.
So, in your case,
[tex] x^2-sx+p = x^2-7x+12 \iff s = 7,\quad p=12[/tex]
So, we're looking for two numbers [tex] x_1,\ x_2 [/tex] such that:
[tex] x_1+x_2 =7,\quad x_1x_2=12 [/tex]
you can clearly check that these numbers are 3 and 4.