Step 1 :
Factor out common factor $ \color{blue}{ p^2 } $:
$$ 2p^3q-2p^3+p^2q-p^2 = p^2 ( 2pq-2p+q-1 ) $$Step 2 :
To factor $ 2pq-2p+q-1 $ we can use factoring by grouping.
Group $ \color{blue}{ 2pq }$ with $ \color{blue}{ -2p }$ and $ \color{red}{ q }$ with $ \color{red}{ -1 }$ then factor each group.
$$ \begin{aligned} 2pq-2p+q-1 &= ( \color{blue}{ 2pq-2p } ) + ( \color{red}{ q-1 }) = \\ &= \color{blue}{ 2p( q-1 )} + \color{red}{ 1( q-1 ) } = \\ &= (2p+1)(q-1) \end{aligned} $$