All this is assuming you can still boot into Windows 11/10 in a regular way. If you cannot, the only way is to use a bootable USB drive. You can then use the advanced recovery. Reset Windows Format ...
When you run the format command in Command Prompt to format a drive on your Windows 11 or Windows 10 computer, the format operation may fail or be unable to complete and output the message Bad sectors ...