The exact statement of the problem is:
If $M$ is compact and $0$ is a regular value of $f:M\to\mathbb R,$ then there is a neighborhood $U$ of $0\in\mathbb R$ such that $f^{-1}(U)$ is diffeomorphic to $f^{-1}(0)\times U$ by a diffeomorphism $\phi:f^{-1}(0)\times U\to f^{-1}(U)$ with $f(\phi(p,t))=t.$
I want to find a vector field $X$ on a neighborhood of $f^{-1}(0)$ which can be pushed forward to $d/dt$ on $\mathbb R.$ From there it seems like I could then find a coordinate neighborhood $x$ about each point in $f^{-1}(0)$ such that in this neighborhood $X$ looks like $\partial/\partial x^1,$ use a compactness argument, and somehow get the proof out of this. However, I don't know how to go about defining such a vector field $X.$ I'm also wondering whether this is true when $M$ is not compact, but I don't exactly know how I would go about proving this.
Even just a hint would be helpful.