The GUI does not respond or is slow, but the CPU and RAM are in good condition

Animations (eg when opening a window or clicking on an icon or scrolling through a terminal window) in the GUI of my macOS are choppy and are not smooth, and it takes a while to respond to a click or pressing a key. This happens throughout the operating system, and is not specific to any application. Why is this so and how can I improve this?

I have checked the Activity Monitor and I have the following:
(1) 9.64 of 32GB memory in use, 0 swap used
(2) 94% inactive CPU