\(2x^2-6x+xy-3y=\left(2x^2-6x\right)+\left(xy-3y\right)=2x\left(x-3\right)+y\left(x-3\right)=\left(x-3\right)\left(2x+y\right)\)
\(\left(2x^2-6x\right)+\left(xy-3y\right)=2x\left(x-3\right)+y\left(x-3\right)=\left(x-3\right)\left(2x+y\right)\)
\(=2x\left(x-3\right)+y\left(x-3\right)=\left(x-3\right)\left(2x+y\right)\)