[proofplan]
The proof uses the Morse-theoretic form of the Lefschetz hyperplane theorem: after choosing the hyperplane section smoothly, the pair $(X,Y)$ has the homotopy type of a relative CW-complex obtained from $Y$ by attaching cells of real dimension at least $n$. Once this cell-attachment statement is available, the conclusion is purely homotopy-theoretic. Cells of dimension at least $n$ make the relative homotopy groups $\pi_k(X,Y)$ vanish for $k \leq n-1$, and the long exact sequence of the pair then gives isomorphisms below degree $n-1$ and surjectivity in degree $n-1$.
[/proofplan]
[step:Reduce the theorem to the Lefschetz cell-attachment form]
We use the following standard Morse-theoretic Lefschetz input: for a smooth hyperplane section $Y = X \cap H$ of a smooth complex projective manifold $X$ of complex dimension $n$, there is a relative CW-pair $(Z,Y)$ and a homotopy equivalence of pairs under $Y$
\begin{align*}
\Phi: (Z,Y) \longrightarrow (X,Y)
\end{align*}
such that $Z$ is obtained from $Y$ by attaching cells of real dimensions $d \geq n$. The phrase "under $Y$" means that if
\begin{align*}
j: Y \hookrightarrow Z
\end{align*}
denotes the CW-pair inclusion, then the composite $\Phi \circ j: Y \to X$ is homotopic to the original inclusion
\begin{align*}
i: Y \hookrightarrow X.
\end{align*}
This is the Morse-theoretic Lefschetz cell-attachment theorem for the pair $(X,Y)$. Its hypotheses apply here because $X \subset \mathbb P^N$ is a smooth complex projective manifold and $Y = X \cap H$ is a smooth hyperplane section. The Morse-theoretic proof uses a Lefschetz pencil or an equivalent strictly plurisubharmonic exhaustion adapted to the hyperplane section; the complex Hessian index estimate gives the handle decomposition of the pair $(X,Y)$ with relative handles of real index at least $n$. Thus the theorem supplies the cell-attachment conclusion needed here directly, not merely a CW-decomposition of the affine complement $X \setminus Y$. Since this result is not yet available as a resolved theorem in the wiki, we record the external dependency explicitly: (citing a result not yet in the wiki: Morse-theoretic Lefschetz cell-attachment theorem).
Because homotopy groups of pairs are invariant under homotopy equivalence of pairs under $Y$, it suffices to prove the result for the relative CW-pair $(Z,Y)$ and then transfer it along $\Phi$.
[guided]
The geometric content of the theorem is contained in the Lefschetz cell-attachment statement. It says that passing from the hyperplane section $Y$ to the whole manifold $X$ does not require attaching low-dimensional relative cells: all attached cells have real dimension at least $n$.
We verify the hypotheses of this external input in the present setting. The theorem requires a smooth complex projective manifold and a smooth hyperplane section. These are exactly the assumptions in the statement: $X \subset \mathbb P^N$ is smooth and projective of complex dimension $n$, and $Y = X \cap H$ is assumed smooth. Therefore the Morse-theoretic Lefschetz cell-attachment theorem gives a CW-pair $(Z,Y)$ and a homotopy equivalence of pairs under $Y$
\begin{align*}
\Phi: (Z,Y) \longrightarrow (X,Y),
\end{align*}
where $Z$ is constructed from $Y$ by attaching cells of real dimensions $d \geq n$. Under $Y$ means that, for the inclusion
\begin{align*}
j: Y \hookrightarrow Z,
\end{align*}
the composite $\Phi \circ j$ is homotopic to the original inclusion
\begin{align*}
i: Y \hookrightarrow X.
\end{align*}
The Morse-theoretic proof is a statement about the relative pair $(X,Y)$: one uses a Lefschetz pencil or an equivalent strictly plurisubharmonic exhaustion adapted to $Y$, and the complex Morse index estimate produces relative handles of real index at least $n$. This direction is important. A bound on the indices in the affine complement alone would not by itself prove the required lower bound on the dimensions of cells attached to $Y$; the external Lefschetz theorem supplies the relative handle conclusion directly.
Homotopy equivalence of pairs preserves the relative homotopy groups $\pi_k(-,-)$ and is compatible with the long exact homotopy sequence of the pair. Therefore the desired statement for $(X,Y)$ follows once it is proved for $(Z,Y)$ and then transferred along the under-$Y$ equivalence $\Phi$. Since this input is not yet a resolved theorem in the wiki, the citation is recorded explicitly as an external dependency: (citing a result not yet in the wiki: Morse-theoretic Lefschetz cell-attachment theorem).
[/guided]
[/step]
[step:Show that the relative homotopy groups vanish below the attached cell dimension]
Let $m$ be the smallest dimension of a cell attached to $Y$ in the CW-pair $(Z,Y)$. By the Lefschetz cell-attachment form, $m \geq n$. The relative CW-complex $(Z,Y)$ has no relative cells of dimension $d < m$.
By the relative cellular approximation theorem and the relative homotopy computation for CW-pairs, a relative CW-pair with no cells of dimension less than $m$ satisfies
\begin{align*}
\pi_k(Z,Y,y_0) = 0
\end{align*}
for every integer $k \leq m-1$ and every base point $y_0 \in Y$. Since $m \geq n$, this gives
\begin{align*}
\pi_k(Z,Y,y_0) = 0
\end{align*}
for every $k \leq n-1$.
Here we are using a standard CW-pair connectivity theorem: (citing a result not yet in the wiki: relative cellular approximation and connectivity of CW-pairs).
[guided]
The point of the cell decomposition is that relative homotopy classes in low degrees cannot detect high-dimensional attached cells. Let $m$ denote the smallest dimension of any cell attached to $Y$ in order to obtain $Z$. The Lefschetz cell-attachment theorem gives $m \geq n$.
A based element of $\pi_k(Z,Y,y_0)$ is represented by a continuous map of pairs
\begin{align*}
f: (D^k,S^{k-1}) \longrightarrow (Z,Y),
\end{align*}
where $D^k$ is the closed $k$-disk and $S^{k-1} = \partial D^k$. If $k \leq m-1$, the relative cellular approximation theorem allows $f$ to be homotoped relative to $S^{k-1}$ into the relative $(m-1)$-skeleton of $(Z,Y)$. But the relative $(m-1)$-skeleton is just $Y$, because no cells of dimension less than $m$ were attached. Hence $f$ is homotopic as a map of pairs to a map whose image lies in $Y$, so it represents the zero element of $\pi_k(Z,Y,y_0)$.
Thus
\begin{align*}
\pi_k(Z,Y,y_0) = 0
\end{align*}
for every $k \leq m-1$. Since $m \geq n$, we obtain
\begin{align*}
\pi_k(Z,Y,y_0) = 0
\end{align*}
for every $k \leq n-1$.
This step uses the standard CW-pair connectivity theorem, recorded as an external dependency because it is not yet resolved in the wiki: (citing a result not yet in the wiki: relative cellular approximation and connectivity of CW-pairs).
[/guided]
[/step]
[step:Apply the long exact homotopy sequence of the pair]
For the based pair $(Z,Y,y_0)$, the long exact homotopy sequence gives, for each integer $k \geq 1$, an exact segment
\begin{align*}
\pi_{k+1}(Z,Y,y_0) \longrightarrow \pi_k(Y,y_0) \xrightarrow{j_*} \pi_k(Z,y_0) \longrightarrow \pi_k(Z,Y,y_0),
\end{align*}
where
\begin{align*}
j: Y \hookrightarrow Z
\end{align*}
is the inclusion map.
If $1 \leq k < n-1$, then $k \leq n-2$, so both
\begin{align*}
\pi_{k+1}(Z,Y,y_0) = 0
\quad \text{and} \quad
\pi_k(Z,Y,y_0) = 0
\end{align*}
because $k+1 \leq n-1$ and $k \leq n-1$. Exactness then implies that
\begin{align*}
j_*: \pi_k(Y,y_0) \longrightarrow \pi_k(Z,y_0)
\end{align*}
is an isomorphism.
For $k = n-1$, the exact segment
\begin{align*}
\pi_{n-1}(Y,y_0) \xrightarrow{j_*} \pi_{n-1}(Z,y_0) \longrightarrow \pi_{n-1}(Z,Y,y_0)
\end{align*}
and the vanishing
\begin{align*}
\pi_{n-1}(Z,Y,y_0) = 0
\end{align*}
show that $j_*$ is surjective.
[guided]
The long exact sequence of the pair turns relative vanishing into information about the inclusion-induced map on absolute homotopy groups. For the based inclusion
\begin{align*}
j: Y \hookrightarrow Z,
\end{align*}
the long exact homotopy sequence contains
\begin{align*}
\pi_{k+1}(Z,Y,y_0) \longrightarrow \pi_k(Y,y_0) \xrightarrow{j_*} \pi_k(Z,y_0) \longrightarrow \pi_k(Z,Y,y_0).
\end{align*}
First take $1 \leq k < n-1$. Then $k+1 \leq n-1$, so the previous step gives
\begin{align*}
\pi_{k+1}(Z,Y,y_0) = 0.
\end{align*}
It also gives
\begin{align*}
\pi_k(Z,Y,y_0) = 0.
\end{align*}
Exactness now says two things. Since the kernel of $j_*$ is the image of the zero group $\pi_{k+1}(Z,Y,y_0)$, the map $j_*$ is injective. Since the image of $j_*$ is the kernel of the map from $\pi_k(Z,y_0)$ to the zero group $\pi_k(Z,Y,y_0)$, the map $j_*$ is surjective. Hence $j_*$ is an isomorphism.
Now take $k = n-1$. The relevant exact segment is
\begin{align*}
\pi_{n-1}(Y,y_0) \xrightarrow{j_*} \pi_{n-1}(Z,y_0) \longrightarrow \pi_{n-1}(Z,Y,y_0).
\end{align*}
The previous step gives
\begin{align*}
\pi_{n-1}(Z,Y,y_0) = 0.
\end{align*}
Therefore the image of $j_*$ is the kernel of the zero map out of $\pi_{n-1}(Z,y_0)$, which is all of $\pi_{n-1}(Z,y_0)$. Thus $j_*$ is surjective.
[/guided]
[/step]
[step:Transfer the conclusion back from the CW model to the original inclusion]
Let
\begin{align*}
\Phi: (Z,Y) \longrightarrow (X,Y)
\end{align*}
be the homotopy equivalence of pairs under $Y$ supplied by the Lefschetz cell-attachment theorem. Thus, for the inclusion
\begin{align*}
j: Y \hookrightarrow Z,
\end{align*}
the composite $\Phi \circ j$ is homotopic to the original inclusion
\begin{align*}
i: Y \hookrightarrow X.
\end{align*}
Choose a base point $y_0 \in Y$. The map $\Phi: Z \to X$ is a homotopy equivalence, so the induced map
\begin{align*}
\Phi_*: \pi_k(Z,y_0) \longrightarrow \pi_k(X,y_0)
\end{align*}
is an isomorphism for every $k \geq 1$. Functoriality of homotopy groups and the homotopy $\Phi \circ j \simeq i$ give
\begin{align*}
\Phi_* \circ j_* = i_*: \pi_k(Y,y_0) \longrightarrow \pi_k(X,y_0),
\end{align*}
up to the standard basepoint-change identification determined by the homotopy. Hence $i_*$ is the composite of $j_*$ with an isomorphism. Therefore $i_*$ is an isomorphism for $1 \leq k < n-1$ and a surjection for $k = n-1$.
The same argument applied to path components gives the asserted degree-$0$ statement, with $\pi_0$ interpreted as a pointed set of path components rather than a group. This completes the proof.
[guided]
We now return from the CW model to the original inclusion. The compatibility required here is part of the Lefschetz cell-attachment input used at the beginning: it gives a homotopy equivalence of pairs under $Y$
\begin{align*}
\Phi: (Z,Y) \longrightarrow (X,Y).
\end{align*}
If
\begin{align*}
j: Y \hookrightarrow Z
\end{align*}
is the CW-pair inclusion and
\begin{align*}
i: Y \hookrightarrow X
\end{align*}
is the original hyperplane-section inclusion, then "under $Y$" means that the composite $\Phi \circ j$ is homotopic to $i$ as a map $Y \to X$.
Choose a base point $y_0 \in Y$. Since $\Phi: Z \to X$ is a homotopy equivalence, it induces an isomorphism
\begin{align*}
\Phi_*: \pi_k(Z,y_0) \longrightarrow \pi_k(X,y_0)
\end{align*}
for every $k \geq 1$. Homotopy groups are functorial: applying them to the composite $\Phi \circ j$ gives $\Phi_* \circ j_*$. Since $\Phi \circ j$ is homotopic to $i$, homotopy invariance gives
\begin{align*}
\Phi_* \circ j_* = i_*: \pi_k(Y,y_0) \longrightarrow \pi_k(X,y_0),
\end{align*}
up to the standard basepoint-change identification determined by the homotopy.
This identity is exactly what is needed. For $1 \leq k < n-1$, the previous step proved that
\begin{align*}
j_*: \pi_k(Y,y_0) \longrightarrow \pi_k(Z,y_0)
\end{align*}
is an isomorphism. Composing an isomorphism with the isomorphism $\Phi_*$ gives an isomorphism, so $i_* = \Phi_* \circ j_*$ is an isomorphism. For $k = n-1$, the previous step proved that $j_*$ is surjective. Composing a surjection with the isomorphism $\Phi_*$ gives a surjection, so $i_*$ is surjective in degree $n-1$.
For $k = 0$, the same functorial argument applies to path components, with $\pi_0$ interpreted as a pointed set rather than a group. This completes the transfer from the CW model to the original pair $(X,Y)$.
[/guided]
[/step]