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.
Here is an approach. Assume we have the ode
$$ a(x)y''+b(x)y'+c(x)y = 0 \longrightarrow (*)$$
and we want to have the Sturm Liouville Form. Multiply $(*)$ by the function $\mu(x)$ as
$$ \mu\,a y''+\mu b y'+\mu c y = 0 .$$
To determine $\mu(x)$ we have
$$(\mu a y' )' +\mu c y = 0 $$
$$ \implies (\mu a)' = \mu b $$
$$ \implies \mu(x) = e^{\int \frac{b(x)-a'(x)}{a(x)}}. $$
Now you can advance.
Best Answer
What you need to do is write the equation as $$ \frac{d}{d x}\left\{p(x) \frac{d y}{d x}\right\} + \big(q(x) + \lambda r(x)\big)y = 0 $$
In order to do that, multiply the ODE by an integrating factor $\mu(x) > 0$, $$ x^2 \mu y'' + 3 x \mu y' + \lambda \mu y = 0 $$
The first term can be written as $$ \frac{d}{dx} \left\{ x^2 \mu \frac{d y}{d x}\right\} - \frac{d y}{d x} \frac{d}{d x}\left(x^2 \mu\right) $$ and then the ODE becomes $$ \left(x^2 \mu y'\right)' + \left[3 x \mu - \left(x^2 \mu\right)'\right]y' + \lambda \mu y = 0 \tag{1} $$ If $$ 3x\mu - (x^2 \mu)' = 0 \tag{2} $$ then the ODE $(1)$ is of the Sturm-Liouville form. Clearly, the solution for $(2)$ is $$ \mu (x) = x $$ which means that, if we multiply the original equation by $x$, then $$ x\left(x^2 y'' + 3 x y' + \lambda y\right) = x^3 y'' + 3 x^2 y' + \lambda x y = \color{red}{\left(x^3 y'\right)' + \lambda x y = 0}. $$