A subset $S$ of a topological space $(X,\tau)$ is said to be compact if every open cover of $S$ has a finite subcover. That is, if $\mathcal U = {U_i}_{i\in I}\subset\tau$ is a set of open sets such that $S\subset \cup(\mathcal U)$, then there necessarily exists a finite subset of indices $\mathcal U'\subset \mathcal U$ such that $S\subset \cup(\mathcal U')$. Moreover, if $(X,\tau)$ is the metric topology induced by some metric space on $X$, then $S$ is said to be sequentially compact if every sequence of points of $S$ has a convergent subsequence which converges to a point of $S$. Additionally, $S$ is called countably compact if every countable open cover of $S$ has a finite subcover.
Here are some "fast facts" about compactness that are helpful to keep in mind, many of which are proven below:
Compactness implies countable compactness.
Compactness and sequential compactness are equivalent, assuming the Axiom of Choice .
Closed subsets of compact sets are compact.
Continuous functions preserve compact sets.
Proposition 1. A subset $S$ of a metric space $M$ is compact iff it is sequentially compact.
Proof. Suppose that $S$ is not sequentially compact, so that there exists a sequence of points $(x_n)$ such that no subsequence of $(x_n)$ converges to any point of $S$. Therefore, for any $x\in S$, we may define Now consider the family $\mathcal U = {B(x;r(x)):x\in S}$ of open sets, which covers $S$ since each $x\in S$ is the center of $B(x;r(x))$. By compactness, it must have a finite subcover. But this is impossible, because for any individual ball in this cover, the sequence $(x_n)$ eventually lies entirely outside of that ball, meaning that it eventually lies outside the union of any finite collection of such balls - implying that there would exist $x_N$ not contained in any ball of the finite subcover. Hence, compactness must imply sequential compactness.
Now suppose $S$ is sequentially compact. We may immediately show that $S$ is countably compact using the Axiom of Choice : for if $U_1,U_2,\cdots$ were a countable open cover of $S$ with no finite subcover, then the sets $S\backslash U_1$, $S\backslash (U_1\cup U_2),\cdots$ would be nonempty, so that we could find a sequence of points $(x_n)$ with but any limit point of this sequence would have to be contained in $S$ and not in any of the $U_i$, contradicting the assumption that $U_1,U_2,\cdots$ was a countable open cover of $S$. Hence, $S$ must be countably compact.
Now, we may show that since $S$ is sequentially compact, for any $r>0$, there is a finite cover of $S$ by balls of radius $r$. For if this were not the case, using AOC, we could choose arbitrary $x_1\in S$, then choose arbitrary $x_2\in S\backslash B(x_1;r)$, and then choose $x_3\in S\backslash (B(x_1;r)\cup B(x_2;r))$, and so on, constructing an infinite sequence $(x_n)$ in which any two points are separated by a distance of at least $r$. But such a sequence could not have a limit point, contradicting sequential compactness. Thus, for any $r>0$, $S$ can be covered by finitely many balls of radius $r$.
For each $n\in\mathbb N$, let $\mathcal U_n$ be a family of open balls of radius $1/n$ covering $S$, constructed with the aid of the Axiom of Choice once more. Now let $\mathcal U$ be an arbitrary open cover of $S$, and let $\mathcal U^\ast$ be the subset of $\mathcal U_1\cup\mathcal U_2\cup \cdots$ consisting of the open balls that are contained in at least one of the open sets of $\mathcal U$. We have that $\mathcal U^\ast$ is also an open cover of $S$, for if $x\in S$, then $x\in U\in \mathcal U$ for some $U$, and since $U$ is open, we have $x\in B(x;n^{-1})\subset U$ for some $n\in\mathbb N$. But this means $\mathcal U^\ast$ is a countable open cover of $S$, and it therefore has a finite subcover. For each of the open balls in this finite subcover, we may choose some open set from $\mathcal U$ containing it as a subset, so that the collection of these open sets comprises a finite subcover of $\mathcal U$. Hence, we have constructed a finite subcover of the arbitrary open cover $\mathcal U$, meaning that $S$ is compact. Hence, sequential compactness implies compactness. $\blacksquare$
One important property of compactness is that it is "hereditary" in a certain sense:
Proposition 2. Every closed subset of a compact set is compact.
Suppose that in a topological space $(X,\tau)$, the set $S\subset X$ is compact and the set $S'\subset S$ is closed. Let $\mathcal U'$ be an arbitrary open cover of $S'$, and let $\mathcal U$ be an arbitrary open cover of $S$. Then consider the set so that $\mathcal U^\ast$ is an open cover of $S$. It therefore contains some finite subcover $U_1,\cdots,U_k\in\mathcal U^\ast$. If we consider the sets from among $U_1,\cdots,U_k$ that have nonempty intersection with $S'$, they must comprise a cover of $S'$, and must furthermore be a finite subcover of $\mathcal U'$, proving that $\mathcal U'$ has a finite subcover covering $S'$, and that $S'$ is compact. $\blacksquare$
Another important fact about compactness is that it is preserved by continuous functions:
Proposition 3. If a function $T:X\to Y$ between topological spaces is continuous, then $T(S)$ is compact for every compact subset $S\subset X$.
Proof. First of all, suppose $T:X\to Y$ is continuous and $S\subset X$ is compact. Let $\mathcal U$ be an open cover of $T(S)$. Then ${T^{-1}(U):U\in\mathcal U}$ is an open cover of $S$, since the preimage of an open set under a continuous function is open. This cover has a finite subcover by compactness of $S$, and if $T^{-1}(U_1),\cdots, T^{-1}(U_k)$ covers $S$, we have that $U_1,\cdots,U_k$ covers $T(S)$. Thus $\mathcal U$ has a finite subcover, and since it was an arbitrary open cover of $T(S)$, we have that $T(S)$ is compact. $\blacksquare$