bytlan is correct.
you need to go to the website of your manufacturer, there should be guides in there for the model of your laptop/desktop. Look for something that says about "recovery disc" or "reinstall"
computers that come with preinstalled with windows usually provide a software that can create your "recovery cd". recovery cd's contain the automated installer for windows and all the drivers. when you need to reformat your computer, backup all your files on a flash drive or external hard drive, then use the recovery cd to format your computer to the default factory settings.
if the manufacture website/manula does not say of a recovery disc, then your computer probably has a hidden partition on its hard drive. this hidden partition contains the automated windows and driver installers.
if you can give us the brand and model number of your computer, we can help you check the manufacturer website and instructions