Step 1 :
Factor out common factor $ \color{blue}{ ab } $:
$$ a^2b^2+2a^2b+3ab^2+6ab = ab ( ab+2a+3b+6 ) $$Step 2 :
To factor $ ab+2a+3b+6 $ we can use factoring by grouping.
Group $ \color{blue}{ ab }$ with $ \color{blue}{ 2a }$ and $ \color{red}{ 3b }$ with $ \color{red}{ 6 }$ then factor each group.
$$ \begin{aligned} ab+2a+3b+6 &= ( \color{blue}{ ab+2a } ) + ( \color{red}{ 3b+6 }) = \\ &= \color{blue}{ a( b+2 )} + \color{red}{ 3( b+2 ) } = \\ &= (a+3)(b+2) \end{aligned} $$