[step:Convert sequential compactness into compactness]
We now prove that $M$ is compact. Let $\mathcal{U}$ be an arbitrary open cover of $M$. Suppose, toward a contradiction, that no finite subfamily of $\mathcal{U}$ covers $M$. For a non-empty subset $A \subset M$, define its diameter by
\begin{align*}
\operatorname{diam}(A) := \sup\{d(u,v) : u,v \in A\}.
\end{align*}
First we show that there exists $\delta > 0$ such that every subset of $M$ with diameter less than $\delta$ is contained in some member of $\mathcal{U}$. If not, then for every $m \in \mathbb{N}$ there exists a non-empty subset $A_m \subset M$ such that
\begin{align*}
\operatorname{diam}(A_m) < 2^{-m}
\end{align*}
and $A_m$ is not contained in any member of $\mathcal{U}$. Choose $y_m \in A_m$ for each $m \in \mathbb{N}$. By the sequential compactness proved in the previous step, the sequence $(y_m)_{m=1}^{\infty}$ has a convergent subsequence $(y_{m_j})_{j=1}^{\infty}$ with limit $y \in M$.
Since $\mathcal{U}$ covers $M$, choose $U \in \mathcal{U}$ such that $y \in U$. Because $U$ is open, there exists $r > 0$ such that
\begin{align*}
B(y,r) \subset U.
\end{align*}
Choose $j$ so large that
\begin{align*}
d(y_{m_j},y) < \frac{r}{2}
\end{align*}
and
\begin{align*}
2^{-m_j} < \frac{r}{2}.
\end{align*}
For every $z \in A_{m_j}$, the definition of diameter gives
\begin{align*}
d(z,y_{m_j}) \leq \operatorname{diam}(A_{m_j}) < 2^{-m_j}.
\end{align*}
Therefore
\begin{align*}
d(z,y) \leq d(z,y_{m_j}) + d(y_{m_j},y) < r.
\end{align*}
Thus $A_{m_j} \subset B(y,r) \subset U$, contradicting the choice of $A_{m_j}$. Hence such a number $\delta > 0$ exists.
Since $M$ is totally bounded, choose finitely many points $c_1,\dots,c_N \in M$ such that
\begin{align*}
M \subset \bigcup_{i=1}^{N} B(c_i,\delta/3).
\end{align*}
For each $i \in \{1,\dots,N\}$, define
\begin{align*}
C_i := M \cap B(c_i,\delta/3).
\end{align*}
Then
\begin{align*}
M = \bigcup_{i=1}^{N} C_i.
\end{align*}
If $u,v \in C_i$, then the triangle inequality gives
\begin{align*}
d(u,v) \leq d(u,c_i) + d(c_i,v) < \frac{2\delta}{3} < \delta.
\end{align*}
Hence $\operatorname{diam}(C_i) < \delta$ for every $i \in \{1,\dots,N\}$. By the defining property of $\delta$, for each $i \in \{1,\dots,N\}$ there exists $U_i \in \mathcal{U}$ such that
\begin{align*}
C_i \subset U_i.
\end{align*}
Consequently
\begin{align*}
M = \bigcup_{i=1}^{N} C_i \subset \bigcup_{i=1}^{N} U_i.
\end{align*}
Thus $U_1,\dots,U_N$ is a [finite subcover](/page/Finite%20Subcover) of $\mathcal{U}$, contradicting the assumption that $\mathcal{U}$ had no finite subcover. Therefore every open cover of $M$ has a finite subcover, so $M$ is compact.
[/step]