You solve the substitution method to solve a system of equality by expressing one variable in terms of the other using one equation, and then plugging this expression in the other(s).
In this case, the first equation gives us a way to express n in terms of m. So, we can replace every occurrence of n in the second equation with the given formula.
The result is
So, the second equation turned to be an equality, i.e. an equation where both sides are the same.
This implies that the system has infinitely many solutions, because every couple such that is a solution to the system, because it satisfies both equations: the first is trivially satisfied, whereas the second is an identity, and as such is satisfied by any value of the variable.