Step 1 :
Factor out common factor $ \color{blue}{ 3xy } $:
$$ 3x^3y-12xy = 3xy ( x^2-4 ) $$Step 2 :
Rewrite $ x^2-4 $ as:
$$ \color{blue}{ x^2-4 = (x)^2 - (2)^2 } $$Now we can apply the difference of squares formula.
$$ I^2 - II^2 = (I - II)(I + II) $$After putting $ I = x $ and $ II = 2 $ , we have:
$$ x^2-4 = (x)^2 - (2)^2 = ( x-2 ) ( x+2 ) $$