To factor $ x^2-ax+cx-ac $ we can use factoring by grouping.
Group $ \color{blue}{ x^2 }$ with $ \color{blue}{ -ax }$ and $ \color{red}{ cx }$ with $ \color{red}{ -ac }$ then factor each group.
$$ \begin{aligned} x^2-ax+cx-ac &= ( \color{blue}{ x^2-ax } ) + ( \color{red}{ cx-ac }) = \\ &= \color{blue}{ x( x-a )} + \color{red}{ c( x-a ) } = \\ &= (x+c)(x-a) \end{aligned} $$