To factor $ 12gh-18g+2h-3 $ we can use factoring by grouping.
Group $ \color{blue}{ 12gh }$ with $ \color{blue}{ -18g }$ and $ \color{red}{ 2h }$ with $ \color{red}{ -3 }$ then factor each group.
$$ \begin{aligned} 12gh-18g+2h-3 &= ( \color{blue}{ 12gh-18g } ) + ( \color{red}{ 2h-3 }) = \\ &= \color{blue}{ 6g( 2h-3 )} + \color{red}{ 1( 2h-3 ) } = \\ &= (6g+1)(2h-3) \end{aligned} $$