How to Fix Desktop Window Manager (dwm.exe) from using high RAM or High
CPU
Methods to fix Desktop Window Manager (dwm.exe) from using high RAM or
CPU:
Method#1:
Turn off Screen Saver: [If it still isn't solved, proceed to method #2]
Go to Settings>Personalisation>Lock Screen>Screen saver settings
and keep screen saver as none

Method#2:
Turn off Background Apps:
[If it still isn't solved, proceed to method #3]
Go to Settings>Privacy>Background Apps>Turn off background
apps which is not necessary for you

Method#3:
Update Windows and Drivers:
[If it still isn't solved, proceed to method #4]
Update Windows and Graphics Drivers [Intel, NVIDIA, AMD]
Method#4:
Perform Deployment Image Servicing and Management: [If it still isn't solved, proceed to method #5]
Windows 10 may have some missing operating system files. Use a command prompt to perform Deployment Image Servicing and Management (DISM) tasks for Windows 10 Health.
>Open cmd [Run as administrator] and perform the commands shown
below
Dism /Online /Cleanup-Image /CheckHealth
Dism /Online /Cleanup-Image /ScanHealth
Dism /Online /Cleanup-Image /RestoreHealth

Method#5:
Perform System File Check:
[If it still isn't solved, proceed to method #6]
>Open cmd [Run as administrator] and perform a command shown
below
SFC/SCANNOW
The System File Checker is a utility in Microsoft Windows that allows users to scan and restore corrupted Windows system files.

Method#6:
Windows Update diagnostic troubleshooting task:[If the problem is not solved, proceed to the final method]
Open cmd [Run as administrator] and perform the command shown below.
msdt.exe /id WindowsUpdateDiagnostic

Last Method #:
[Final Solution]
Force to End dwm.exe Task
Finally, the last method is to end the desktop window manager in Task Manager.

Lastly, Restart your computer...
Note: I faced this issue on 30
Sep 2020
Finally solved, shown image