use of metric

Question: Given a open set U and a compact set C such that C \subset U,
prove that you can find a compact set D such that C \subset interior of D and D \subset U.

Use a metric function that measures the distance between the complement of U and C.(f(x)=inf_{y \in U/X} |x-y|:x \in C) Take the inf of the function and show that it must be strictly bigger than 0 (inf_{x \in C} f(x) >0). Call the distance $epsilon and then \frac{\epsilon}{2} .
Then $ f^{-1}([\frac{\epsilon}{2}, \infty]) is the compact set we want.