Theory:

Factorisation by taking out the common binomial factor from each term of the algebraic expression.
Consider $\left({n}^{2}+1\right)\left(m-n\right)+\left({m}^{2}+1\right)\left(m-n\right)$.

Take binomial factor from each term commonly outside.

$\left({n}^{2}+1\right)\underset{¯}{\left(m-n\right)}+\left({m}^{2}+1\right)\underset{¯}{\left(m-n\right)}$

$=\left(m-n\right)\left({n}^{2}+1+{m}^{2}+1\right)$

$=\left(m-n\right)\left({n}^{2}+{m}^{2}+2\right)$