Use the theory of orthogonal functions to find best in the mean approximation of the function $\sin(πx)$ on the interval $[0,1]$ by a second-order polynomial
That is, find such coefficients $a_0, a_1$ and $a_2$ that,
$$\int^1_0 (\sin(\pi x)-a_0-a_1x-a_2x^2)^2 \, dx, $$
takes a minimal possible value.
I feel as though this has something to do with Fourier series but I really cant be sure because I am not very familiar with this area.
Also, I'm not sure what "best in mean approximation" means, so any help with that would be great.

Your problem is equivalent of finding the projection of $f : \rightarrow \sin(\pi x) $ on the vectorial space $F\triangleq \operatorname{Vect}(1,\mathrm{Id},\mathrm{Id}^2)=R_2[X]$ and calculating the distance of $f$ to $F$
In order to do this decompose the projection of $f$ which is
$$ P_F(f) = a_0 + a_1X+ a_2X^2 $$
On the normalized base relatively to your scalar product (you have to Schmidt the canonical of $\mathbb{R}_2[X]$ relatively to your scalar product).
And find the coefficient of $P_F(f) $ in your Schmited basis, those are consequently linked to your $a_0,a_1,a_2$
Once you find it, compute
$$d(f, F)^2=\|f-P_F(f)\|^2$$
which is your integral squared, minimized by the definition of the projection.
Furthermore,
We call mean approximation because it is an average made through an integral (which plays the role of "continuous" averages when we need it instead of summing, here your interval has a mesure of $1$ so it is an average (sum divided by the amplitude of number we take)
Don't hesitate if you need precision.