I replaced both of my sunroof's broken drive belts last month. ($250 for both at Toyotapartszone.) The portion of the belt that actually connects to the sunroof is made of plastic. These get brittle and eventually break.
The first step is to remove the sliding bit of headliner attached to the sunroof by prying down on the forward edge. You can then access and remove the eight bolts holding the sunroof, then lift it out.
After removing the mirror, sun visors, passenger assist handle, sunroof switch assembly, sunroof headliner moulding(around the edge of the opening) and A-pillar covers the head liner can be pulled down in the front.
Then remove the electrical connections to the sunroof motor, remove the three bolts mounting the sunroof motor and pull it out. Then remove the two bolts running from underneath the roof into the sunroof assembly.
The remaining screws are all accessed from above, be aware that these may be extremely stubborn. Once the air deflector screws and the sunroof assembly screws are removed the entire unit is pulled up and forward through the opening. The sticky sealant on the bottom of the assembly will offer some resistance.
Once removed, the assembly has two screws holding the three pieces of the U-shaped assembly together. I had to drill both of these stubborn screws out and find replacements at the local hardware store.
You can then remove the belts, clean the assembly of the years of dirt, lube it up (including the new belts) and reinstall.
Once reinstalled the sunroof operated perfectly with no further adjustments required.