Proof (examples of normal spaces)

Metric space

For any point $x\in X$ and any subset $E \subseteq X$, define $$ \begin{align*} d(x,E) = \inf\sb{d(x,y)}{y\in E}. \end{align*} $$ Note $d(x,E) = 0$ iff $x\in \overline{E}$.

Given disjoint closed sets $A,B\subseteq X$, define $$ \begin{align*} U ={}& \sb{x\in X}{d(x, A)< d(x,B)}, \\ V ={}& \sb{x\in X}{d(x, A)> d(x,B)}. \end{align*} $$

Clearly $U$ and $V$ are disjoint. Also since $x\mapsto d(x,A) - d(x,B)$ is continuous, $U$ and $V$ are open. Moreover if $x\in A$, then $x\not\in B = \overline{B}$, so $d(x,A) = 0 < d(x,B)$ and thus $x\in U$. Similarly $B \subseteq V$.

Compact Hausdorff space

Let $A, B$ be disjoint closed sets. Since $X$ is compact, $A,B$ are compact.

Fix $x\in A$. For any $y\in B$, using the Hausdorff property as $x\neq y$, let $U_{xy}, V_{xy}\subseteq X$ be disjoint open subsets such that $x\in U_{xy}$, $y\in V_{xy}$. $\sb{V_{xy}}{y\in B}$ is an open cover of $B$, which is compact, so find $y_1, \ldots, y_n\in B$ such that $B \subseteq \bigcup_{i=1}^{n} V_{xy_i}$. Then define $$ \begin{align*} U_x := \bigcap_{i=1}^{n} U_{xy_i} \ni x, \qquad V_x := \bigcup_{i=1}^{n} V_{xy_i} \supseteq B, \end{align*} $$ which are disjoint and both open as finite intersection and union of open sets.

Now $\sb{U_x}{x\in A}$ is an open cover of $A$, so by compactness, find $x_1, \ldots, x_m\in A$ such that $A \subseteq \bigcup_{i=1}^{m} U_{x_i}$. Then we obtain $$ \begin{align*} U := \bigcup_{i=1}^{m} U_{x_i}\supseteq A, \qquad V := \bigcap_{i=1}^{m} V_{x_i} \supseteq B, \end{align*} $$ which are disjoint and both open.