prove every bounded sequence of a compact metric space has a convergent subsequence let $(X,d)$ be a compact metric space. Using the definition, show every bounded sequence of $X$,  has a subsequent converging in $X$.

I know how to prove this for real numbers . and real numbers are not even compact.
I also know the definition of compactness. but I do not know how to think of this proof. I need some help with an idea at least please. Thanks
 A: I would do a proof by contradiction: Assume that there's a bounded sequence with no convergent subsequence. Then no point appears infinitely often in that sequence, and no point in $X$ is a limit point of the sequence. Since no point in $X$ is a limit point, then $\forall x \in X$, you can choose an open ball $B_{\epsilon}(x)$ such that the sequence does not contain any points in that ball, except for $x$, which only occurs finitely many times.  All of those balls form an open cover of $X$, so there is a finite subcover. But that means that the sequence only has finitely many terms, which is a contradiction.
A: The sequence being $(a_n)_{n\in \mathbb{N}}$ or $a \colon \mathbb{N}\to X$, show first that there exists a point $x \in X$ such that for every $U$ open containing $x$ we have 
$$\{ n \in \mathbb{N} \ | a_n \in U\}= a^{-1}(U)$$
is infinite.  Assume the contrary. Then for every $x$ there exists $U_x$ open subset containing $x$ so that $a^{-1}(U_x)$ is finite. Since $X$ is compact, finitely many $U_{x_1}$, $\ldots$, $U_{x_m}$ will cover $X$
and we get 
$$\mathbb{N} =a^{-1}(X) = \cup_{i=1}^m a^{-1} (U_{x_i})$$
finite, contradiction. 
Now consider such an $x$ as above. Take $a_{n_1} \in B(x,1)$, $n_2> n_1$ with $a_{n_2}\in B(x, \frac{1}{2})$, $\ldots$, $n_k > n_{k-1}$ such that 
$a_{n_k} \in B(x, \frac{1}{k})$. The subsequence $(a_{n_k})_k$ has limit $x$. 
