If you see a popup like this telling you that you cant modify a file because it is locked or used by another process
You can find out which process is locking or using the file with Resource Monitor. To do so follow these steps:
Open Resource Monitor and go to the CPU tab.
In the search bar at Associated Handles input the file name.
You will now see a list of processes locking the file.
See picture below for reference: