Let $X$ be a Hausdorff space and let $A,B\subseteq X$ two compact subspaces which don't intersect. Show exist $U,V\subseteq X$ open which don't intersect s.t $A\subseteq U,B\subseteq V$.
I thought taking $A\ni a\neq b\in B$ and since $X$ is Hausdorff, $$\exists S_{a,i}\in N(a),S_{b,j}\in N(b):S_{a,i}\cap S_{b,j}=\emptyset$$ and taking $S_a=\bigcap_{a\in A,i\in I}S_{a,i},S_b=\bigcap_{b\in B,j\in J}S_b$ as my $U$ and $V$.
The only problem is I don't use the compactness. What am I missing? Is my solution correct?