If you are unable to delete a File/Folder on your computer, the problem is most likely due to the File/Folder being used by another program or occupied by an ongoing process on the computer.
This problem can also be caused due to the File/Folder being set to read-only mode or deletion of the File being prevented or blocked by the Antivirus program installed on the computer.
Can’t Delete File/Folder in Windows 11/10
It is recommended that you begin by restarting the computer. This can help, if the problem is being caused due to the File/Folder being stuck or occupied by a background running app or process.
If you are still unable to delete the File/Folder, you should be able to delete the File/Folder by using Safe Mode and other methods as provided below in this guide.
Note: If you are dealing with this problem on a Microsoft Excel File, you can refer to this guide: Fix: Excel File Locked For Editing By Another User.
1. Restart File Explorer
Terminating the File Explorer process and restarting it back again should help in fixing the problem.
1. Right-click on the Taskbar and click on Task Manager.
2. On the Task Manager screen, switch to the Processes Tab, right-click on Windows Explorer and click on End Task.

3. Select the File Tab and click on Run New Task option.

4. Type Explorer.exe and press the Enter key to restart the File Explorer process.

After this, try to delete the File again.
2. Delete the File/Folder in Safe Mode
Restart the computer in Safe Mode and try to delete the File.
1. Type Command Prompt in the Search bar > Right-click on Command Prompt and select Run as Administrator option.

2. On the Command prompt screen, type bcdedit /set {current} safeboot minimal and press the Enter key.

3. Next, type shutdown /r and wait for the computer to restart in Safe Mode.
After the computer Restarts in Safe Mode, you should be able to delete the File.
After deleting the File, you can exit Safe Mode by using any of the methods as provided in this guide: 4 Ways to Exit Safe Mode in Windows 11/10.
3. Change File/Folder Permissions
If you are unable to delete File/Folder due to lack of permissions, you can change the permission levels for the File/Folder.
1. Right-click the File/Folder that you are unable to delete and click on Properties.

2. On the Properties screen, switch to Security tab and click on Advanced.

3. On the next screen, go to Permissions tab and see if there is any permission entry that contains “Deny”.
If you find any entry containing “Deny”, select the Entry and click on the Remove button.

4. Click on OK to save changes and exit the permissions screen.
After this, you should be able to delete the file or folder that you were unable to delete on the computer.
4. Delete File/Folder Using Command Prompt
If above methods did not help and you know for sure that the File/Folder is not currently being used by another User, you should be able to delete the File/Folder using Command Prompt.
For the actual steps to delete File/Folder using Command prompt, you can refer to this guide: Delete Locked File/Folder Using Command Prompt.