To factor $ 8x^2y+10+5xy+16x $ we can use factoring by grouping.
Group $ \color{blue}{ 8x^2y }$ with $ \color{blue}{ 10 }$ and $ \color{red}{ 5xy }$ with $ \color{red}{ 16x }$ then factor each group.
$$ \begin{aligned} 8x^2y+10+5xy+16x &= ( \color{blue}{ 8x^2y+5xy } ) + ( \color{red}{ 10+16x }) = \\ &= \color{blue}{ xy( 8x+5 )} + \color{red}{ 2( 5+8x ) } = \\ &= (xy+2)(8x+5) \end{aligned} $$