When a PC has just been hit by malware, encryption seems like the obvious next step. But locking files down before the virus is gone simply traps the problem along with your data.
This guide shows the right order: how to clean up first and then encrypt a drive after a virus infection.
Encryption protects data from being read. It does not remove malware that is already on the machine.
The correct sequence is always: clean the system, verify it is gone, and only then set up encryption.
A locked drive and antivirus work together in different ways; see Can Antivirus Scan an Encrypted Drive? for what each does.
Once the PC is clean, Qiling Safe Disk puts your important files inside a protected container. Download and install it first.
Step 1. Open Qiling Safe Disk and click Create to make a container.

Step 2. Set a size, choose AES-256, and set a long, unique password.
Step 3. Mount the container and copy your important files inside it.

Step 4. Unmount when you are done so the files are locked and hidden again.
The point is to bring only clean files into the container, so the protection you build stays meaningful.
Encryption is layer two. Cleaning the machine is the step that comes first.
Yes, once it is fully clean. Protect your files after the threat is removed, not before.
No. Encryption hides and protects data; it does not delete malware.
Malware can be copied into a container like any file, so only move in files you have verified as clean.
Yes. A locked container resists ransomware, but clean up the machine and restore from a backup first.
Always. Keep a clean copy of your files and the container on a separate drive.
Before installing security software or changing storage, create a full Windows backup. Qiling Disk Master creates a system image you can restore from.
Step 1. Open Qiling Disk Master and select System Backup to include Windows and the boot partitions.
Step 2. Save the image to a drive other than the Windows disk and start the backup.
Step 3. If a change causes issues, restore from the image to return Windows to its working state.
After a virus infection, the order of your actions decides the outcome. Encryption protects data; it does not clean a machine, and locking files down before the malware is gone simply seals the threat inside. Disconnect the PC, scan it fully, remove anything suspicious, and confirm it is clean before you do anything else. Then create a container with Qiling Safe Disk, copy in only the files you have verified, wipe the exposed originals, and keep a clean backup on another drive. Do it in that order and encryption becomes a strong final layer instead of a problem waiting to reopen.
For more on protecting files after trouble, see How to Back Up an Encrypted Drive, How to Securely Erase an Encrypted Drive, How to Create an Encrypted Virtual Drive, and How to Use Qiling Safe Disk.