Refinishing headlights is a risky business if not done properly. Especially when you only have pitting and not just oxidation. Typically when a headlight becomes yellow from oxidation we would sand off the old UV layer, then use a 2K clear coat spray to finish it off. The issue with this is now you've completely removed the OEM UV protection and the headlights will never be the same. If you skip the 2K clear and just polish them out and use a coating or sealant, they will oxidize again in a matter of months.
With pitting, I'm not even sure if you could remove it all, and your UV layer would be totally shot. I would either replace the headlights (I know, some are crazy expensive) and then PPF them, or go ahead and just PPF them. The PPF may help hide some of that pitting.