The cohomology ring of the Hilbert scheme of $3$ points on a smooth projective variety