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