It is a well-known fact that in Hausdorff spaces ($T_2$) compact sets are closed. As always in topology, you can find examples topological spaces in which this is not the case – although there are some restrictions to it. Just to spoil you a bit, as described in [Wil67], we have strict implications $$ T_2 ⇒ KC ⇒ US ⇒ T_1, $$ where $KC$ means “compact sets are closed“ and $US$ means “convergent sequences have a unique limit”.
We can derive the proof from first principles (well, including choice) via the following observation:
LEM Let $X$ be a $T_2$ space, $K\subseteq X$ compact. Then all points $y\not\in K$ can be separated from the latter with an open set disjoint from $K$.
Proof. For every $x\in K$, we certainly have $y\neq x$, impliying there are disjoint open sets $U_x\ni x$, $V_x\ni y$. Certainly, $\{U_x\mid x\in K\}$ covers $K$, so there are finitely many ${(x_i)}_i$ such that $U_{x_i}$ still covers $K$. It is then easy to see that $\bigcap_i V_{x_i}$ is an open set containing $y$ which is disjoint to $K$.
COR Compact sets in a $T_2$ space are closed.
Proof. Certainly, the union of such sets $V_y$ from the following lemma covers the complement of $K$, implying it is open.
QUESTION However, what if we consider this lemma an axiom? Where does it lie between $T_2$ and $KC$?
→ TODO, obviously.
[Wil67] Albert Wilansky. Between $T_1$ and $T_2$.