Firstly, with your sunroof fully open, make sure the edges of the aperture in the roof are clean. Give them a good polish with AutoGlym Super Resin Polish or similar.
Next, make sure that the "hairy" seal around the edge of the glass panel is clean, and free of all green verdigris. If necessary (after covering your seats etc), clean it with a hot water and bleach solution, carefully with a toothbrush. You'll need to jiggle the sunroof between partially slid rearwards, and fully tilted to get to all the edges.
Finally, pop along to your local stealer, and get a can of genuine sunroof spray grease, and lubricate the guides and mechanism. It can be tricky working out where to spray the grease, but if you stand on an open door sill, and watch the mechanism work as you open and close the roof, you should be able to work out where to lube.
PS, don't leave any of the grease lying on exposed paintwork, as it can stain after a while.
HTH