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