Does anyone understand how to solve this?

You solve it by filling in the function value and simplifying the result.
a.
[tex]\displaystyle \frac{f(x)-f(a)}{x-a}=\frac{\left(3x^{2}+x+3\right)-\left(3a^{2}+a+3\right)}{x-a}\\\\=\frac{3\left(x^{2}-a^{2}\right)+\left(x-a\right)}{x-a}\\\\=\frac{3(x+a)(x-a)+(x-a)}{x-a}=3(x+a)+1[/tex]
b.
[tex]\displaystyle \frac{f(x+h)-f(x)}{h}=\frac{\left(3(x+h)^{2}+(x+h)+3\right)-\left(3x^{2}+x+3\right)}{h}\\\\=\frac{\left(3\left(x^{2}+2hx+h^{2}\right)+(x+h)+3\right)-\left(3x^{2}+x+3\right)}{h}\\\\=\frac{3\left(2hx+h^{2}\right)+h}{h}=6x+1+3h[/tex]