To factor $ 4xy+12x+7y+21 $ we can use factoring by grouping.
Group $ \color{blue}{ 4xy }$ with $ \color{blue}{ 12x }$ and $ \color{red}{ 7y }$ with $ \color{red}{ 21 }$ then factor each group.
$$ \begin{aligned} 4xy+12x+7y+21 &= ( \color{blue}{ 4xy+12x } ) + ( \color{red}{ 7y+21 }) = \\ &= \color{blue}{ 4x( y+3 )} + \color{red}{ 7( y+3 ) } = \\ &= (4x+7)(y+3) \end{aligned} $$