Given: $X$ Hausdorff, $K \subset X$ compact.
Show: If $p \in X \setminus K $, then there are disjoint $O_1, O_2$ such that, $p \in O_1$ and $K \subset O_2$ open.
My answer to this problem doesn't use the property of $K$ being compact, which makes me uncertain, whether my proof is correct.
Thus I would be happy, if someone could quickly proofread it.
My answer: Using $X$ Haussdorf: $\forall k \in K, \exists O_p , O_k \subset X$ open, such that $p \in O_p$ and $k \in O_k$ (1)
Thus $K \subset \bigcup\limits_{k \in K}^{} O_k = O_2$ union of open sets. Since $O_p$ and $O_k$ disjoint for any k, $O_p \cap O_2 = \emptyset \quad \square $
I guess my proof goes awry in (1), as I create a set $O_p$ for every $O_k$. Let's get four specific sets: $O_p$ for a $O_k$ and $O_{p'}$ for $O_{k'}$.
While $p \in O_p, O_{p'} $ and $O_p \cap O_k = \emptyset$, $O_{p'} \cap O_{k'}= \emptyset$, this does not imply $O_p \cap \cap O_{k'} = \emptyset = O_{k} \cap O_{p'} $ and I guess my proof breaks. However, what would be an example to further illustrate, that $K$ being compact is actually needed?
For sure there is a flaw in your proof. The issue is that $O_p$ depends on $k \in K$ in (1).
$\mathbb R^2$ equipped with the Euclidean norm is Haussdorf. Take for $K$ the open disk $D$ centered on $(1,0)$ of radius $1$ and for $p$ the origin. It is impossible to find $O_1, O_2$ as described in your question.