hello,
If your planning to format your sysmtem
take your files and folders backup
if you are formatting total drives
1.) Take bakup and format.
else if you are formatting only os drive
2.)According my experience I will suggest you to connect your hard drive to another system(antivirus must be installed) as a secondary and scan with antivirus.
and connect scanned hard drive to its actual cpu after that format and install your required drivers and software.