I am learning about Fourier series in class and the basic form of a Fourier Series is
$$a_{0}+\sum_{n=1}^{\infty} [a_{n}\cos(nx)+b_{n}\sin(nx)]$$
so a fourier series should have an infinity number of terms.
I was reading the book and it says that the fourier series of $\cos^{2}(3x)$ is $\frac{1}{2}+\frac{1}{2}\cos(6x)$. I am assuming the $\frac{1}{2}$ is the $a_{0}$ term. If this is the fourier series, why does it not have an infiniti number of terms like the form above? Why does it only stop at one term after the $\frac{1}{2}$ term?
Because your function is actually a finite linear combination of terms like those appearing in Fourier series. There is no magic involved: if you compute all coefficients you will find that most are zero. The series has infinitely many terms, but all but a finite number of them vanish.
For a simpler example, try to find the Fourier series of $\cos(17x)$.