If your sunroof is randomly opening or tilting by itself, it's time to replace the switch. The contacts seem to wear out or bend over time, causing it to malfunction.
If you're wondering, I would rate this as One Star, Extremely Easy. Like, if you aren't able to do this, you probably...