[guided]We are given that $R$ has a unique maximal ideal $\mathfrak{m}$, and we want to identify $\mathfrak{m}$ with the set of non-units $R \setminus R^\times$. This will simultaneously show that $R \setminus R^\times$ is an ideal (the substantive content) and that it is the unique maximal ideal (the "in which case" clause).
\textbf{Strategy.} We show double inclusion.
\textbf{Forward inclusion: every element of $\mathfrak{m}$ is a non-unit.} Suppose, for contradiction, that some $u \in \mathfrak{m}$ is a unit, with inverse $v$. Then $uv = 1$, and since $\mathfrak{m}$ is an ideal it absorbs multiplication: $1 = uv \in \mathfrak{m}$. But $\mathfrak{m}$ is a proper ideal (maximal ideals are proper by definition), so $1 \notin \mathfrak{m}$. Contradiction. Hence $\mathfrak{m}$ contains no units, i.e. $\mathfrak{m} \subset R \setminus R^\times$.
\textbf{Reverse inclusion: every non-unit lies in $\mathfrak{m}$.} This is where locality enters. Take a non-unit $x \in R \setminus R^\times$. The principal ideal $(x)$ is proper: if $(x) = R$, then $1 \in (x)$, so $1 = rx$ for some $r \in R$, exhibiting $x$ as a unit with inverse $r$, contradiction. So $(x) \subsetneq R$.
By the existence-of-maximals fact (Step 1), the proper ideal $(x)$ is contained in some maximal ideal $\mathfrak{m}'$. The hypothesis is that $R$ has \emph{unique} maximal ideal $\mathfrak{m}$, so $\mathfrak{m}' = \mathfrak{m}$. Hence $x \in (x) \subset \mathfrak{m}' = \mathfrak{m}$.
\textbf{Conclusion.} The two inclusions give $\mathfrak{m} = R \setminus R^\times$. Since $\mathfrak{m}$ is an ideal, so is $R \setminus R^\times$. And since $\mathfrak{m}$ is the unique maximal ideal of $R$ by hypothesis, $R \setminus R^\times$ is the unique maximal ideal.
\textbf{Why uniqueness of $\mathfrak{m}$ matters.} Without uniqueness, the reverse inclusion fails: if $R$ had multiple maximal ideals $\mathfrak{m}_1, \mathfrak{m}_2$, a non-unit $x$ might lie in $\mathfrak{m}_1$ but not in $\mathfrak{m}_2$, so $R \setminus R^\times$ — the union of all maximal ideals — would strictly contain each $\mathfrak{m}_i$. In a local ring, this union is a single ideal because there is a single maximal ideal.
\textbf{Aside: additive closure of non-units.} An equivalent formulation of "$R \setminus R^\times$ is an ideal" is "the sum of two non-units is a non-unit". For a local ring this is sometimes shown directly: if $x, y$ are non-units and $x + y$ were a unit with inverse $u$, then $1 = u(x+y) = ux + uy$, so $1 \in \mathfrak{m} + \mathfrak{m} = \mathfrak{m}$, contradicting properness. Our argument above absorbs this directly through identifying the set with $\mathfrak{m}$.[/guided]