OP is reading Milnor's celebrated Topology from the Differentiable Viewpoint's 6th chapter, where he deals with indices of vector fields and in particular the Poincare-Hopf theorem. A lemma he used is stated and proved as following:
For any (smooth) vector field $v$ on (smooth, compact, boundaryless) manifold $M$ With only non degenerate zeros the index sum $\sum \iota$ is equal to the degree of the Gauss mapping: $g:\partial N_{\epsilon}\to S^{k-1}$. In particular this sum does not depend on the choice of vector field.(OP:$N_\epsilon$ is the $\epsilon$-thickening of $M$, which in the first place is embedded into $\mathbb R ^k$.)
Proof
For $x\in N_{\epsilon}$ let $r(x)$ denote the closest point on $M$. ...... $x-r(x)$ will be perpendicular to $TM_x$. For sufficiently small $\epsilon$, $r(x)$ is well defined and smooth.
Consider the squared distance function $\phi(x)=||x-r(x)||^2$. An EASYcomputation shows $\operatorname {grad} \phi (x) = 2(x-r(x))$. Hence, for each point on the level surface $\partial N_\epsilon = \phi ^{-1} (\epsilon^2)$ the outward normal vector is given by $g(x) = \frac {\operatorname {grad} \phi (x) }{||\operatorname {grad} \phi (x) ||}=(x-r(x))/\epsilon$. Extend $v$ to a vector field $w$ on the neighbourhood $N_\epsilon$ by setting $w(x)=x-r(x)+v(r(x))$. Then $w$ points outward along the boundary, since the inner product $w(x)\bullet g(x)$ is equal to $\epsilon >0$. Note that $w$ can vanish only at the zeros of $v$ in $M$; this is CLEAR since the summands $x-r(x)$ and $v(r(x))$ are mutually orthogonal.(Unfinished, but the OP is unable to proceed)
There is lack of clarity in the proof. The two places I used bold letters are my problems.
First, how is it easily computed that $\operatorname{grad} \phi(x)=2(x-r(x))$, without the derivative of $r(x)$ with respect to $x$ appearing?
Second and the most severe one that makes me doubt my sanity: how can $x-r(x)$ be generally perpendicular to $v(r(x))$? I don't think the assumption that vector field $v(x)$ is a tangent vector field is ever made in this chapter, so we have freedom of choosing the direction of $v(x)$ at a certain point, yet Milnor claims it must be tangent?
(Milnor's book is OP's first exposure to differential topology and therefore I entrusted the introduction to him skinny book. So the OP has no other knowledge on diff-top (e.g. transversality, cobordism, etc..) other than what's in this booklet.)