Hello
Thank you for your question and reaching out.
I can understand you are having some issues with Windows 2022 of Freezing or Hang.
Please note you should use Local Workstation for Development purpose as Visual studios are quite Resource intensive and its not good to use Server Edition to use Visual Studio for Development purpose.
In your case you can Disable any Antivirus program or Windows firewall you may have for temporary purpose.
If you have installed SQL on this Server 2022 then you can Limit its Memory.
You can also use processor to find out which sub processes or thread using high CPU.
https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer
-------------------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept as answer--