The steps which are required for solving a Fourier series are as follows:
Multiply the function by cosine or sine and then integrate it.
Take n = 0, n = 1, n = 2, etc. to calculate the value of coefficients.
In the end, add all the respective coefficients in the Fourier formula.