Settings of Display an Monitor freeze and get error

All settings work fine, except Display an Monitor. When I go into it, all the graphics freeze for 15 seconds and then open a tab. Also when switching to Night Color and Compositor there is an error Failed to connect to Window Manager. How do I fix this?