I'm reading below lemma from this lecture note.
Lemma 8.1. There is a smooth function, $\theta_0: \mathbb{R}^n \longrightarrow[0,1] \subseteq \mathbb{R}$, with $\theta_0(x)=1$ whenever $\|x\| \leq 1$, and with $\theta_0(x)=0$ whenever $\|x\| \geq 2$. Proof. We construct $\theta_0$ in stages. First, define $\theta_1: \mathbb{R} \longrightarrow \mathbb{R}$ by $\theta_1(t)=$ $e^{-1 / t}$ for $t>0$ and $\theta_1(t)=0$ for $t<0$. This is smooth (exercise). Now set $\theta_2(t)=\theta_1(t) /\left(\theta_1(t)+\theta_1(1-t)\right)$. Thus $\theta_2 \mid(1, \infty) \equiv 1$ and $\theta_2 \mid(-\infty, 0] \equiv 0$. Now set $\theta_0(x)=\theta_2(\color{red}{\|2-x\|})$ for $x \in \mathbb{R}^n$. This is also smooth.
Could you confirm that the author meant $\theta_0(x)=\theta_2(\|2-x\|^2)$ rather than $\theta_0(x)=\theta_2(\|2-x\|)$? This is because $\|2-x\|$ is not differentiable at $x=2$.
$\frac {\theta_2(2-\|x\|)-\theta_2(0)} {2-\|x\|} \to 0$ as $\|x\| \to 2$ because $\theta_2'(0)=0$. In fact, all derivatives of $\theta_2(2-\|x\|)$ at $x$ are $0$ when $\|x\|=2$.