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 ...
Discover how to use Windows 11 Command Prompt for repair tasks. Learn step-by-step commands to fix system errors, boot issues ...