to more easy to understand why it comes up 3x(x-2)
3x1 = 3
3x2 = 6
so both 3 and 6 is had a factor of 3
then
3x^2 = 3 times x times x = 3x(x)
-6x = 3 times 2 times x = 3x(2)
then the equation becomes
3x(x)-3x(2) =
3x is common to both terms
so you can put it outside of the terms and put parentheses to know that it is to be multiply
like this : 3x(x-2)