Firstly any mods that came with an installer should be first uninstalled through the apps menu or they might cause problems later because of missing registry keys. Then back up the C&O folders to any NTFS drive or partition that ISN’T where you will put windows and rename them. Once you have your new system in place rename the changed C&O folders back to the original. Then start the MSFS download but be sure to pause after the first couple of files.
You then have two choices, either move those folders back to their default location replacing the empty C&O folders there or simply update UserCfg.opt with the new path to your packages. Restart the download and it should recognise the changes immediately however if not you can kill the sim in taskmanager and start downloading again from the beginning and it should then take minutes rather than hours. Test it works before reinstalling any mods that you prevously discarded and always use the latest versions when you do.
P.S. make sure you are logged in to Xbox and Store/Steam before downloading the sim
Note that Appdata is a hidden folder. That bottom-level Packages folder can be anywhere you like; specify it at reinstallation time, copy your backup into it, and you’re ready to fly.
To illustrate, I have the sim on C: as per the default, and my packages are in D:\FSPackages. That contains both Community and Official\OneStore. I too had to reinstall a few months ago (not the sim’s fault, something different), and after I did the above, the sim made friends with my packages straight away and off I went into the wild blue yonder.
Remember that, if packages have been updated between uninstall and reinstall, the old packages will probably cause problems, so you’ll need to check Content Manager before trying to fly.
ETA: that’s odd; in the path in my post, there should be a backslash after “Users” but the forum won’t let me enter it. Oo-er…