To factor $ 5ab+2b+5ac+2c $ we can use factoring by grouping.
Group $ \color{blue}{ 5ab }$ with $ \color{blue}{ 2b }$ and $ \color{red}{ 5ac }$ with $ \color{red}{ 2c }$ then factor each group.
$$ \begin{aligned} 5ab+2b+5ac+2c &= ( \color{blue}{ 5ab+2b } ) + ( \color{red}{ 5ac+2c }) = \\ &= \color{blue}{ b( 5a+2 )} + \color{red}{ c( 5a+2 ) } = \\ &= (b+c)(5a+2) \end{aligned} $$