Back up anything you want to keep on some kind of external storage (local or
cloud) and make sure you have installation media or downloads (in a safe place,
again external storage, local or cloud) for any software you will want to
reinstall.
Write the installation software to your installation media (usually either a
DVD or USB flash drive)