[guided]This step is the technical heart of the argument. We need to pass from a separation of $K$ in the subspace topology to a separation by open sets of the ambient space $X$.
Suppose $K = A_0 \cup B_0$ with $A_0, B_0$ non-empty, disjoint, and open in the subspace topology of $K$. Since $K = A_0 \cup B_0$ is a disjoint union and both sets are open in $K$, each is the complement of the other in $K$, hence also closed in $K$. Since $K$ is compact, $A_0$ and $B_0$ — being closed subsets of a compact space — are themselves compact.
Now we must find disjoint open sets $U \supset A_0$ and $V \supset B_0$ in $X$. This is a standard compactness argument in Hausdorff spaces, proceeding in two stages:
**Stage 1: Separate a single point from $B_0$.** Fix $a \in A_0$. For each $b \in B_0$, since $a \neq b$ and $X$ is Hausdorff, there exist disjoint open sets $U_{a,b} \ni a$ and $V_{a,b} \ni b$. The collection $\{V_{a,b}\}_{b \in B_0}$ is an open cover of $B_0$. By compactness of $B_0$, there exist $b_1, \ldots, b_m$ with $B_0 \subset V_{a,b_1} \cup \cdots \cup V_{a,b_m}$. Setting $U_a = \bigcap_{j=1}^m U_{a,b_j}$ and $V_a = \bigcup_{j=1}^m V_{a,b_j}$, we have $a \in U_a$ (a finite intersection of open sets), $B_0 \subset V_a$ (a union of open sets), and $U_a \cap V_a = \varnothing$ (since $U_a \subset U_{a,b_j}$ and $U_{a,b_j} \cap V_{a,b_j} = \varnothing$ for each $j$).
**Stage 2: Separate $A_0$ from $B_0$.** The collection $\{U_a\}_{a \in A_0}$ covers $A_0$. By compactness, there exist $a_1, \ldots, a_k$ with $A_0 \subset U_{a_1} \cup \cdots \cup U_{a_k}$. Setting $U = \bigcup_{i=1}^k U_{a_i}$ and $V = \bigcap_{i=1}^k V_{a_i}$, we get disjoint open sets with $A_0 \subset U$ and $B_0 \subset V$.
Why the asymmetry between union and intersection? For $U$, we take a union to ensure $A_0 \subset U$, and for $V$, we take an intersection to ensure disjointness: $U_{a_i} \cap V_{a_i} = \varnothing$ for each $i$, so $U_{a_i} \cap V = \varnothing$ (since $V \subset V_{a_i}$), and therefore $U \cap V = \varnothing$.[/guided]