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