I try to prove $f(x)=\cos\sqrt{x},x\in[0,\infty)$ is uniformly continuous use definition: $\exists \delta>0,\forall x_1,x_2\in[0,+\infty) ,|x_1-x_2|<\delta,|\cos \sqrt{x_1} -\cos \sqrt{x_2}|< \varepsilon$
Here is my attempt $|\cos \sqrt{x_1} -\cos \sqrt{x_2}|=|-\frac{1}{2}\sin(\frac{\sqrt{x_1}+\sqrt{x_2}}{2})\sin(\frac{\sqrt{x_1}-\sqrt{x_2}}{2})|\leq|\frac{1}{2} \cdots\cdots|???$
I know $|\sin x|\leq 1$, how to select $\delta$?
Let $x,y\in [0,+\infty)$ be arbitrary and assume WLOG $x>y$, so by the mean value theorem there exists $\xi_{x,y} \in (y,x)$ such that: $$|\cos\sqrt{x}-\cos\sqrt{y}|=\left|-\frac{\sin \sqrt{\xi_{x,y}}}{2\sqrt{\xi_{x,y}}}\right|\cdot|x-y|=\frac{|\sin \sqrt{\xi_{x,y}}|}{2\sqrt{\xi_{x,y}}}|x-y|$$ Using that $|\sin t| \le |t|$ for each $t\in\mathbb{R}$, we have: $$\frac{|\sin \sqrt{\xi_{x,y}}|}{2\sqrt{\xi_{x,y}}}|x-y| \le \frac{|x-y|}{2}$$ Let $\epsilon>0$ be arbitrary and let $x,y \in [0,+\infty)$ be arbitrary. Set $\delta_{\epsilon}:=2\epsilon$, so $|x-y|<\delta_\epsilon$ implies: $$|\cos\sqrt{x}-\cos\sqrt{y}|\le \frac{|x-y|}{2}<\epsilon$$ Notice that this holds for arbitrary $x,y \in[0,+\infty)$ because of the WLOG argument.
Alternatively, we can save your first attempt avoiding the mean value theorem. Notice that, using the same inequality on sine mentioned above, we have: $$|\cos \sqrt{x}-\cos\sqrt{y}|=2\left|\sin\frac{\sqrt{x}+\sqrt{y}}{2}\right|\cdot\left|\sin\frac{\sqrt{x}-\sqrt{y}}{2}\right|$$ $$\le2\frac{|\sqrt{x}+\sqrt{y}|}{2}\cdot\frac{|\sqrt{x}-\sqrt{y}|}{2}=\frac{|x-y|}{2}$$ So, again, you can set $\delta_\epsilon:=2\epsilon$.