Depending on the severity of the problem, you may be able to deal with the malware or virus without taking this step (for example, by using high-quality antivirus software or by switching to safe mode ...
Safe Mode lets Windows start with only essential drivers and services, allowing you to troubleshoot crashes, faulty drivers, ...