Here's what to do in order to get the best performance from Windows:
1- Only install Windows on supported hardware.
2- After installing, only add hardware that is supported on the version of Windows you have.
3- Only install apps that are supported on the version of Windows you have.
4- Only operate Windows according to Microsoft's instructions, and don't make unsupported changes to the operating system.
5- Keep Windows free of malware.
I follow these steps myself, and my Windows 11 and Windows 10 computers run quickly and are trouble free, with no crashes, no lags, no strange behavior.