Related problems: (I), (II). First solve the differential equation
$$ X(x)=c_1\,\sin \left( \sqrt {\lambda}x \right) + c_2\,\cos\left( \sqrt {\lambda}x \right) .$$
Applying the boundary conditions to the solution results in the two equations
$$ { c_1}\,\sin \left( \sqrt {\lambda}\pi \right) +{c_2}\,\cos\left( \sqrt {\lambda}\pi \right)
=0 \rightarrow (1) $$
$$ {c_1}\,\sqrt{\lambda} = 0 \rightarrow (2), $$
where $c_1$ and $c_2$ are arbitrary constants. From (2), we assume $\lambda\neq 0$, then we will have $c_1=0.$ Substituting $c_1=0$ in (1) gives
$$ {c_2}\,\cos\left( \sqrt {\lambda}\pi \right)
= 0 \implies \cos\left( \sqrt {\lambda}\pi \right)=0 \implies \sqrt{\lambda} = \frac{2n+1}{2} $$
$$ \implies \lambda = \frac{(2n+1)^2}{4},\quad n=0,1,2,3\dots $$
I will leave it here for you to finish the task. Note that, $\lambda = 0 $ is a special case. Subs $\lambda=0$ in the diff. eq. and follow the above technique and see what you get.
Since $C_1 = 0$ follows from the first boundary condition, we have
$$y(\pi) = 0 = C_2 \sin(\sqrt{\lambda}\pi) \implies \sqrt{\lambda}\pi = n\pi \implies \lambda = n^2 \quad (\text{for } n = 1, 2, \ldots).$$
Now you can find the eigenfunctions because
$$y(t) = C_2 \sin(\sqrt{\lambda}t) = C_2 \sin(nt).$$
Note that the case $n = 0$ needs to be studied separately. Just plug in $\lambda = 0$ in the ODE and see what you get. Also, see this related question.
Best Answer
The general solution to $y''+(1+\lambda)y=0$ is $y=A\sin(kx)+B\cos(kx)$
where $k^2 = 1 + \lambda$
the condition $y(0) = 0 $ gives $B=0$
then $ y(\frac{\pi}{2})=0$ requires that k be an even integer $k=2n$
So for every positive integer $n$
$y_n = A \sin (2nx)$
$\lambda_n = 4n^2 -1$