Recently I have had an issue that whenever I connected an external monitor to my laptop it would just freeze. This is on an Asus laptop with nvidia graphics.

The only way I managed to solve it was by following this solution https://answers.microsoft.com/en-us/windows/forum/all/windows-10-reset-external-monitors-settings/b3a53cef-e54f-4410-b09e-6846fa297a3f

The solution was essentially deleting these reg folders

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Connectivity
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\ScaleFactors

With this, all configuration is deleted and when you connect a monitor you may need to reconfigure if it’s extended, duplicated, etc.

Hope this is helpful to others.