This is a common problem & the cables usually bend out of shape & force past the retainers in the sunroof frame. The cables & the retainers should be replaced.
Here is a diagram showing the retainers that screw into the side of the frame (these have been modified from a 1 screw to a 2 screw fitting) item #59:Retainers
Here are the cables, #5 & 8:Cables
The roof panel needs to be removed - remove the side trim panels to see the screws holding the panel to the frame - remove the screws & take the panel out.
The front interior light panel needs to be removed - unclip the lens covers & you will see 2 metal clips, release these with a screwdriver & pull the panel out.
You can then get to the motor for the sunroof - remove the screws & take the motor out.
Remove the small plastic retainers.
The sunroof cables can then be unscrewed from the roof opening & pulled out.
Install the new cables & retainers.
The sunroof can then be re-assembled & the sunroof panel needs to be correctly tensioned or it will bind up in the roof.
Its not the easiest of jobs if this is the first time you have done a job like this! Care must be taken to ensure the roof lines up correctly on installation.
Best regards, Paul