Proof (Heine-Borel, compact iff totally bounded and complete)
We use the equivalence of compactness and sequential compactness.
Sequentially compact $\implies$ totally bounded
See here.
Sequentially compact $\implies$ complete
Let $\set{x_n}$ be a Cauchy sequence in $X$.
By sequential compactness, there exists a subsequence $\set{x_{n_k}}$ which converges to say $x\in X$. Then $$ \begin{align*} d(x_k, x) \leq \underbrace{d(x_k, x_{n_k})}_{\to 0\text{ by Cauchy}} + \underbrace{d(x_{n_k}, x)}_{\to 0\text{ by convergence}} \end{align*} $$ so $x_k\to x$ as $k\to \infty$.
Totally bounded and complete $\implies$ sequentially compact
Let $\set{x_n}_{n=1}^\infty$ be a sequence in $X$. It suffices to show that $\set{x_n}$ has a Cauchy subsequence, which converges by completeness. If $\sb{x_n}{n\in \N}$ is finite, then we are done by taking a constant subsequence, so assume not.
Since $X$ is totally bounded, let $F_1\subseteq X$ be a finite set of points such that $X = \bigcup_{y\in F_1} B_1(y)$. There exists $y_1\in F_1$ such that $B_1(y_1)$ contains infinitely many $x_n$'s (since $\set{x_n}$ is infinite and $F_1$ is finite). Then pick $n_1\in \N$ such that $x_{n_1} \in B_1(y_1)$.
Inductively assume there are infinitely many $x_n$'s contained within $B_1(y_1) \cap B_{1/2}(y_2) \cap \ldots \cap B_{1/(k-1)}(y_{k-1})$ for some $k\geq 2$. Let $F_k\subseteq X$ be a finite set such that $X = \bigcup_{y\in F_k} B_{1/k}(y)$. There exists $y_k\in F_k$ such that $B_1(y_1) \cap \ldots \cap B_{1/(k-1)}(y_{k-1}) \cap B_{1/k}(y_k)$ contains infinitely many $x_n$'s. Pick $n_k > n_{k-1}$ such that $x_{n_k} \in B_1(y_1) \cap \ldots \cap B_{1/k}(y_k)$.
The sequence $\set{x_{n_k}}_{k=1}^\infty$ is Cauchy since for $l\geq k$, $$ \begin{align*} x_{n_k}, x_{n_l} \in B_{1/k}(y_k) \implies d(x_{n_k}, x_{n_l}) < \frac{2}{k} \xrightarrow{k\to\infty} 0. \end{align*} $$