Let $X$ be locally compact space.Prove that every compact subspace has a compact neighbourhood.
We should prove that for any $K$ compact there exists $H\subset X$ compact such that $K \subset H^{\circ}$
Proof
Let $K\subset X$, consider $x\in K$ since $X$ is locally compact then exits an open set $U_{x}$ that contains $x$ and compact $K_{x}$ such that $x\in U_{x}\subset K_{x}$.
Let $H=\bigcup_{x\in K}K_{x}$ which is compact.
Now we want prove that $H^{\circ}=\bigcup_{x\in K}U_{x}$
let $m\in H^{\circ}$ then exists a open neightbourhood $U_{m}\subset H$ that contains $m$ but then $m\in\bigcup_{x\in K}U_{x} $
The conversely is always true.
Now the results follows as well. I never use that $K$ is compact, I don´t know where I made mistake.
Use that $K \subseteq \bigcup_{x \in K} U_x$ which is an open so there is a finite subcover, i.e. a finite $F \subseteq K$ such that
$$K \subseteq \bigcup_{x \in F} U_x$$
and then we can use that this union of open sets is an open neighbourhood of $K$ and is contained in
$$K=\bigcup_{x \in F} K_x$$
which is compact as a finite union of compact sets. You make the mistake of saying that an infinite union of compact sets (your $H$) is compact while this need not be the case at all: recall that any set is a union of (compact) singletons...
So we use compactness to reduce to finitely many open neighbourhoods and corresponding compact supersets. $K^\circ$ is then as required.