I'm trying to prove below result which is used in this answer.
Theorem: Let $(E, d)$ be a metric space, $K \subset E$ non-empty compact, $U \subset E$ open such that $K \subset U$. Then there is $\varepsilon > 0$ such that $$ K_{\varepsilon} := \left \{x \in E \,\middle\vert\, d(x, K) := \inf_{y \in K} d(x, y) \le \varepsilon \right \} \subset U. $$
My below proof is non-constructive. Could you elaborate on an approach that pinpoints the value $\varepsilon$?
Assume the contrary that for each $n$, there is $x_n \in K_{1/n} \setminus U$ and thus $y_{n} \in K$ such that $d(x_{n}, y_{n}) \le 1/n$. Because $K$ is compact, up to a subsequence we assume there is $y \in K$ such that $y_n \to y$. Hence $x_n \to y \in U$. Notice that this is a contradiction because $(x_n) \subset U^c$ which is closed.