Characterization of totally bounded sets in Metric spaces Searching material to know more about totally bounded sets, I found this property

Let $(M,d)$ be a metric space. So $A\subset M$ is totally bounded if and only if for every $\varepsilon >0$ exists a compact $K$ such that $d(x,K)<\varepsilon$ for all $x \in A$

I'd appreciate any hint for proovingg this result.
 A: Since the hinting was successful, let's write it up in full.
Let $A\subset M$ be totally bounded. By the definition of total boundedness, for every $\varepsilon > 0$, there are finitely many points $x_1,\,x_2,\, \dotsc,\, x_{n_\varepsilon}$ such that
$$A \subset \bigcup_{k=1}^{n_\varepsilon} B_\varepsilon(x_k).$$
The set $K_\varepsilon = \{ x_k : 1 \leqslant k \leqslant n_\varepsilon\}$ is finite, hence compact, and for every $x \in A$, there is a $k$ with $x \in B_\varepsilon(x_k)$, hence $d(x,K_\varepsilon) \leqslant d(x,x_k) < \varepsilon$.
Conversely, suppose that $A$ is such that for all $\delta > 0$ there is a compact $K_\delta$ such that for all $x \in A$ we have $d(x,K_\delta) < \delta$.
Let $\varepsilon > 0$. By assumption, there is a compact $K_{\varepsilon/4}$ with $d(x,K_{\varepsilon/4}) < \varepsilon/4$ for all $x \in A$. Since $K_{\varepsilon/4}$ is compact, there are finitely many points $y_1,\, y_2,\, \dotsc,\, y_{n_\varepsilon}$ such that
$$K_{\varepsilon/4} \subset \bigcup_{k=1}^{n_\varepsilon} B_{\varepsilon/4}(y_k).$$
Since $d(x,K_{\varepsilon/4}) < \varepsilon/4$ for all $x \in A$, that implies
$$A \subset \bigcup_{k=1}^{n_\varepsilon} B_{\varepsilon/2}(y_k).$$
Let $ I = \{ k : A \cap B_{\varepsilon/2}(y_k) \neq \varnothing\}$, and for $k \in I$ choose $x_k \in A \cap B_{\varepsilon/2}(y_k)$. Then $B_{\varepsilon/2}(y_k) \subset B_\varepsilon(x_k)$ and
$$A \subset \bigcup_{k \in I} B_\varepsilon(x_k).$$
So for all $\varepsilon > 0$, $A$ can be covered by finitely many balls of radius $\varepsilon$ with centre in $A$, i.e. $A$ is totally bounded.
