Milnor's "Topology from a Differentiable Viewpoint" says the following:
Let $f:M\to N$ be a smooth mapping, where $M$ is $m$ dimensional and $N$ is $n$ dimensional. Moreover, $m\geq n$. If $y\in N$ is a regular value, both for $f$ and the restriction $f|\partial X$, then $f^{-1}(y)\subset X$ is a smooth $(m-n)$ manifold with boundary. Furthermore the boundary $\partial(f^{-1}(y))$ is precisely equal to the intersection of $f^{-1}(y)$ with $\partial X$.
The proof given is the following:
Let $\overline{x}\in f^{-1}(y)$ be a boundary point. We know that $f^{-1}(y)$ is an $(m-n)$ dimension manifold. Take a small neighbourhood $U$ around $\overline{x}$ such that it does not contain any other critical points. Now consider the mapping $\pi:f^{-1}(y)\to R$ defined by $\pi:(x_1,x_2,\dots,x_m)=x_m$. We claim that $\pi$ has $0$ as a regular value: for the tangent space at $f^{-1}(y)$ at $x\in \pi^{-1}(0)$ is equal to the null space of $df:M\to N$.
I don't understand how the line in bold is true!! I have given a photo of the proof given in the book below. The book has a soft copy that is freely available online.


The bolded line is a general claim. Let $f:X\to Y$ be a map of smooth manifolds, and $z$ be a regular value of $f$, so that $f^{-1}(\{z\})$ is an embedded submanifold $W$. Then $TW=\ker df$. This is because tangent vectors to $W$ lie in directions along which $f$ does not vary-since they lie along a level set of $f$-and if $f$ does not vary in some direction from $x$ with $f(x)=z$, then $f(y)=z$ for $y$ in that direction. To make this more formal, take local coordinates so that $W$ is $\mathbf{R}^k\subset\mathbf{R}^n$, $z=0$, and $f$ is the projection onto $(\mathbf{R}^k)^\perp$. Then the kernel of $df$ is just the kernel of $f$, i.e. $W$.