Write $m = qn + r$, where $q,r$ are integers and $0 \le r < n$.
Let $d = \text{gcd}(m,n)$ and let $e = \text{gcd}(n,r)$. The goal is to show $d=e$.
First we show $d|e$ . . .
\begin{align*}
&d = \text{gcd}(m,n)\\[6pt]
\implies\;&d|m \text{ and }d|n\\[6pt]
\implies\;&d|(m - qn)\\[6pt]
\implies\;&d|r
\end{align*}
Since $d|n$ and $d|r$, it follows that $d|\text{gcd}(n,r)$, hence $d|e$.
Next we show $e|d$ . . .
\begin{align*}
&e = \text{gcd}(n,r)\\[6pt]
\implies\;&e|n \text{ and }e|r\\[6pt]
\implies\;&e|(qn+r)\\[6pt]
\implies\;&e|m
\end{align*}
Since $e|m$ and $e|n$, it follows that $e|\text{gcd}(m,n)$, hence $e|d$.
Sincd $d|e$ and $e|d$, it follows that $d = e$.