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