If you get this error on your Windows machine do not format the drive as you will loose all your data.
You just need to use this command to repair the disk:
chkdsk D: /f
Instead of the letter D use the letter got the drive that has the problem and that’s it.
I have found the solution here: https://www.easeus.com/resource/you-need-to-format-the-disk.html (more detailed explanation).