The following theorem is Theorem 3.1 in Morse theory of Milnor. $M^a$ denotes the sublevel set $f^{-1}(-\infty,a]$.
Theorem. Let $f$ be a smooth real-valued function on a manifold $M$. Let $a<b$ and suppose that the set $f^{-1}[a,b]$, consisting of all $p\in M$ with $a\leq f(p)\leq b$, is compact, and contains no critical points of $f$. Then $M^a$ is diffeomorphic to $M^b$. Furthermore, $M^a$ is a deformation retract of $M^b$, so that the inclusion map $M^a\to M^b$ is a homotopy equivalence.
Proof) Choose a Riemannian metric on $M$ and consider the gradient vector field $\text{grad}(f)$. Choose a smooth function $\rho:M\to \Bbb R$ with compact support such that $\rho=1/|\text{grad}(f)|^2$ on $f^{-1}[a,b]$. Then the vector field $X=\rho \cdot \text{grad}(f)$ has compact support, and hence is complete. Let $\varphi_t:M\to M$ be the flow of $X$. For fixed $q\in M$, the map $t\mapsto f(\varphi_t(q))$ has derivative $1$ as long as $f(\varphi_t(q))$ lies between $a$ and $b$. Now consider the diffeomorphism $\varphi_{b-a}:M\to M$. Clearly this carries $M^a$ diffeomorphically onto $M^b$.
Everything is clear except the last sentence. I can't see why $\varphi_{b-a}$ maps $M^a$ diffeomorphically onto $M^b$. I only need to check that $\varphi_{b-a}(M^a)\subset M^b$, but how does this hold?
Fix $q$ in $f^{-1}(a)$, the function defined $g_q(t)=f(\varphi_t(q))$ is a function whose derivative is $1$, $g_q(t)=t+u$, $g_q(0)=a$ implies $g_q(t)=t+a, $ and $g_q(b-a)=b$.