This process is called a clean install, which is ironic as there's nothing particularly clean about it: Microsoft has enshittified Windows Setup.
To fix the issue with Restart on your PC, uninstall the recently installed programs, and pirated programs, scan for malware, disable antivirus, and uninstall it if it is the cause. Make sure you run ...
If you want to de-enshittify Windows 11 but find starting over from scratch to be daunting, then this is for you.