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.