First we will factor out [tex]y[/tex] from [tex]xy+6y[/tex] which gives us [tex]y(x+6)[/tex]
Next we will factor out [tex]-2[/tex] from [tex]-2x-12[/tex] which gives us [tex]-2(x+6)[/tex]
This gives us the equation
[tex]y(x+6)-2(x+6)[/tex]
then factor out the common term [tex]x+6[/tex] and we get
[tex]\left(x+6\right)\left(y-2\right)[/tex]