Step 1: write the number as a product, helps visualizing common factors.
[tex]3*(5g)*g^2 + (2*3)*3 g^2-2*(5g) -2*(2*3)[/tex]
I've marked things being repeating, so, group them up
[tex]5g(3g^2-2)+6(3g^2-2)[/tex]
Now you have a common factor again
[tex](3g^2-2)(5g+6)[/tex]
Extra, if you want to split the first one, you can see it as the difference of [tex](\sqrt{3}g)^2[/tex] and [tex]\sqrt{2}[/tex] which is further split into[tex]( \sqrt{3} g+\sqrt{2}) (\sqrt{3} g-\sqrt{2})[/tex]