This took me awhile to figure out. Thought this would help other people.
Open event viewer. Select Windows Logs on the left. Select system also on the left. You are likely to have a lot error messages. Select filter current log on the right. On the line above task category type 225 for the event id. Read the messages and you will get clues why you can not safely remove hardware.
Here is a video for reference.
RemoveDrive
USB Disk Ejector
quickandeasysoftware.net
A less effective method is to use Process Explorer. I have had less success with this one.
Run process explorer, Find menu, Find Handle or DLL... or hit Ctrl+F, Enter only the drive letter (followed by ":\") in the search text box
LockHunter
My favorite answer. A faster version of the first one. Open a command prompt or powershell.
A lot of good options here
Microsoft's PowerToys - File Locksmith, You need to run this as an admin for it to work. Does not always work.
Open event viewer. Select Windows Logs on the left. Select system also on the left. You are likely to have a lot error messages. Select filter current log on the right. On the line above task category type 225 for the event id. Read the messages and you will get clues why you can not safely remove hardware.
Here is a video for reference.
RemoveDrive
USB Disk Ejector

USB Disk Ejector
A program that allows you to quickly remove USB (and firewire) drives in Windows. It contains many features and flexible options.

A less effective method is to use Process Explorer. I have had less success with this one.
Run process explorer, Find menu, Find Handle or DLL... or hit Ctrl+F, Enter only the drive letter (followed by ":\") in the search text box

Process Explorer - Sysinternals
Find out what files, registry keys and other objects processes have open, which DLLs they have loaded, and more.
learn.microsoft.com
LockHunter
LockHunter is a free 64/32 bit tool to delete files blocked by any processes
LockHunter is a foolproof file unlocker for 32 and 64 Windows
lockhunter.com
My favorite answer. A faster version of the first one. Open a command prompt or powershell.
Code:
wevtutil qe System /q:"*[System[(EventID=225)]]" /c:5 /f:text /rd:true
A lot of good options here
Microsoft's PowerToys - File Locksmith, You need to run this as an admin for it to work. Does not always work.

PowerToys File Locksmith utility for Windows
A Windows shell extension for checking which files are in use and by which processes.
learn.microsoft.com
My Computer
System One
-
- OS
- 10 and 11
- Computer type
- Laptop