When an operating system is infected with viruses and important kernel files are deleted, there is no choice but to rebuild the original operating system. In this case, the computer usually does not turn on at all (the OS does not boot).
You may also need to rewrite or rebuild your system after a technical repair to your computer (e.g. replacing a hard drive).
An important question to ask before overwriting the operating system is whether your computer contains important data. If so, what data needs to be stored. If the computer's hard drive is intact, all important data should be dumped to an external storage medium before the work is carried out, and then uploaded back after the operating system has been restored. However, all the necessary applications have to be reinstalled, the email client has to be reconfigured, etc.
During an operating system overwrite, the hard drive is formatted and all existing information is erased. The disk is partitioned. After this service, the computer works as it did when it was new by removing all potentially unnecessary and overburdening programs that have been installed on the computer.