In the notes I read, the Urysohn lemma is presented before the Tietze extension theorem. Urysohn lemma's utility is quite easy to understand. If we are given a topological space $X$, we want to be able to construct some functions on domain $X$.
I can appreciate this because in some general space , we may not have any additional algebraic structure like we do in $\mathbb{R}$, and hence it could be quite difficult to write down any such function.
But, then what is the use of having the Tietze extension theorem? Is there any natural setting where one would to extend functions on a closed subset of a topological space $X$ into the entire?