You have to generalize the concept of "inner product". In normal 3D-space, it's called the dot product:
$$\langle \vec{x}|\vec{y}\rangle=\vec{x}\cdot\vec{y}=\sum_{j=1}^{3}x_{j}y_{j}.$$
But there are other "spaces" out there: metric spaces, normed spaces, inner product spaces, Banach spaces, Hilbert spaces, Sobolev spaces. They each have different axioms with which you start. The
inner product space is fairly general, and the "vectors" can be the usual vectors in 3D space, or they could be functions in a function space. The usual inner product defined in a function space is
$$\langle f|g\rangle:=\int_{A} \overline{f} \,g\,d\mu.$$
Here $\overline{f}$ indicates the complex conjugate of $f$, and the $d\mu$ indicates that we've defined this integral to be a
Lebesgue integral. $A$ is the set over which the function space is defined.
Now we have the background to answer your question. A Sturm-Liouville operator
$$L=\frac{1}{w(x)}\left(-\frac{d}{dx}\left[p(x)\,\frac{d}{dx}\right]+q(x)\right)$$
is symmetric (more properly, Hermitian) w.r.t. the inner product
$$\langle f|g\rangle:=\int_{A}\overline{f}\,g\,w(x)\,d\mu,$$
if and only if for every $f, g$ in the inner product space, it is true that
$$\langle Lf|g\rangle=\langle f|Lg\rangle.$$
With the Sturm-Liouville operator, you need to show that
$$\int_{A}\overline{\left\{\frac{1}{w(x)}\left(-\frac{d}{dx}\left[p(x)\,\frac{df}{dx}\right]+q(x)f\right)\right\}}\,g\,w(x)\,d\mu=\int_{A} \overline{f} \left\{\frac{1}{w(x)}\left(-\frac{d}{dx}\left[p(x)\,\frac{dg}{dx}\right]+q(x)g\right)\right\}\,w(x)\,d\mu.$$
You can do this using simple integration by parts twice. The boundary terms vanish because of the conditions on them. (Note that the boundary conditions are considered to be part of the operator.)
I note you marked this thread as solved. That is good. Perhaps this post will throw in a few helpful concepts.