I proved the following form of the existence of a smooth Urysohn function::
proposition: For any compact set $K\subset\mathbb R^n$ and any open set $U\subset\mathbb R^n$ where $K\subset U$, there is a smooth($C^{\infty}$) function $f:\mathbb R^n\rightarrow [0,1]$ such that $f_{|_{K}}\equiv1$ and $\ \text{supp}(f)\subset U$.
For the its proof I used compactivity of $K$ strictly for defining $f$ .
Now, I wish to show that if $K$ be only a closed set then the above proposition still hold in the following form:
The problem: For any closed set $C\subset\mathbb R^n$ and any open set $U\subset\mathbb R^n$ where $C\subset U$, there is a smooth($C^{\infty}$) non negative function $f:\mathbb R^n\rightarrow [0,\infty)$ such that $f_{|_{C}}>0$ and $\text{supp}(f)\subset U$.
How?
Since we don't require that $f \equiv 1$ on $C$, we can get by without partitions of unity, although the construction takes us a few steps towards (smooth) partitions of unity.
For $k \in \mathbb{N}\setminus \{0\}$, define
$$C_k := \{ x \in C : k-1 \leqslant \lVert x\rVert \leqslant k\}.$$
Then each $C_k$ is compact (maybe empty), and
$$C = \bigcup_{k = 1}^\infty C_k.$$
Further define small open neighbourhoods
$$U_k := \bigl\{ x \in U : \operatorname{dist}(x,C_k) < \tfrac{1}{3}\bigr\}$$
of $C_k$.
Apply the proposition to all pairs $C_k \subset U_k$ to have a smooth $f_k \colon \mathbb{R}^n \to [0,1]$ with $f_k \equiv 1$ on $C_k$ and $\operatorname{supp} f_k \subset U_k$.
Since $U_k \subset \bigl\{ x \in \mathbb{R}^n : k-\frac{4}{3} < \lVert x\rVert < k + \frac{1}{3}\bigr\}$, every ball with radius $\leqslant \frac{1}{6}$ meets at most two of the $U_k$, hence
$$f(x) := \sum_{k = 1}^\infty f_k(x)$$
converges locally uniformly, and since every point has a neighbourhood on which all but finitely many $f_k$ vanish identically, $f$ is smooth, and $\operatorname{supp} f \subset \bigcup\limits_{k = 1}^\infty U_k \subset U$. And we have $f(x) \geqslant 1$ for $x\in C$.