I had recently created a bootable USB disk for a Linux distro. After I did not use that anymore, I wanted to format it in my Windows 10 machine. But it was not recognized anymore. No drive letter, not visible in File Explorer.
In "Disk Management" it was visible, but I could not format it there either.
Using command line tool "Diskpart" did not help either as the "clean" command ended with an "Access Denied" error.
In the end, the folloing sequence of commands helped me in "Diskpart":
select disk n
attributes disk clear readonly
clean (if this gives no error message, you can go directly to the "create partition" command)
create partition primary
format fs=ntfs quick