This can occur even if you don't see any programs running. It's most likely because another program is currently trying to use the file. Otherwise, a virus must be taken into account. Generally, the file is used or locked would be the main reason. If you want to fix this problem, you must know the reason first. Sometimes you might encounter a folder that you're unable to delete.
Why Can't I Delete the Files on Windows 11/10/8/7 Launch EaseUS Partition Master, right-click the partition you want to erase. Open 'Settings' > Click on 'Update & Security' > Click on 'Recovery' > Under 'Advanced Startup'. Press the Windows key + R and type cmd to open the Command Prompt.
Go to Start, type Task Manager, and choose 'Task Manager' to open it.