Taillights sometimes work, then they both go out, and come back

All the lights except for back up and headlights come together/ split off from the turn signal switch. Id start there if you're SURE the grounds are good