I used NP1 sealant, but there are other good choices. I think you don’t want to use silicon, if I recall correctly? Probably still works.
I didn’t care to fix my worn out sunroof seal and don’t care about being able to open it. With it open, I ran a bead around the inner edge of the opening, closed it to seal to the sunroof itself, and then ran a bead around the seam on top. The switch for the motor shares a connector with the dome light, so you pop the dome light cover off, undo the connector, and pull the corresponding pins. This way you still have a dome light, but can’t accidentally open the sunroof and break the seal. That was my mistake & why I had to reseal it..
Rocker panels are the bottom edge of the vehicle between the wheels - they’re what rock sliders protect, or if stock, it’s the bottom edge that your running boards hang down from.
From under the truck, you’ll see where the front floor drain plug is, and the sunroof drain hole is near there on the inner side of the rocker panel. I’ll see if I can find my picture. The drain hose itself goes down into the rockers, and the little slit in the pinch weld is where water drains. Very small, so easily clogged.
For my windshield, I ran a bead of sealant around each seam, both on the glass side & body side. No leaks ever since.