We have to look for the greatest monomial that "fits" inside both [tex]12x[/tex] and [tex]3x^2[/tex]
As for the numeric part, the greatest common divisor of 12 and 3 is 3 itself, because 3 divides 12.
As for the literal part, [tex]x[/tex] fits inside both [tex]x[/tex] and [tex]x^2[/tex], but we can't choose [tex]x^2[/tex] because it wouldn't fit inside [tex]x[/tex].
So, the greatest common factor is [tex]3x[/tex]. In fact, if we factor it out we get
[tex]3x(4+x)[/tex], and 4 and [tex]x[/tex] don't have any common factor. This proves that we actually factored out the greatest common factor.