To factor $ a^2-2ab+au-2bu $ we can use factoring by grouping.
Group $ \color{blue}{ a^2 }$ with $ \color{blue}{ -2ab }$ and $ \color{red}{ au }$ with $ \color{red}{ -2bu }$ then factor each group.
$$ \begin{aligned} a^2-2ab+au-2bu &= ( \color{blue}{ a^2-2ab } ) + ( \color{red}{ au-2bu }) = \\ &= \color{blue}{ a( a-2b )} + \color{red}{ u( a-2b ) } = \\ &= (a+u)(a-2b) \end{aligned} $$