There are two notions of compactness, they turn out to be equivalent for metric spaces.
Let $X$ be a metric space, $K \In X$ a subset.
The two notions turns out are equivalent, see https://courses.wikinana.org/math104-f21/compactness
We will follow Pugh to give a proof. See also Rudin Thm 2.41
We will finish discussion about compactness. In particular, in $\R^n$, we have Heine-Borel theorem, namely, compact subsets are exactly those subsets which are closed and bounded. Note that, this is false for general metric space, e.g. closed and bounded subset in $\Q$ are not compact.