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