Have you restarted your Mac lately?
Rebooting is the best first step in troubleshooting.
If a simple reboot of your Mac doesn’t fix things, see if the problem still happens in safe mode.
How to use safe mode on your Mac - Apple Support
Safe mode will often correct weird software behavior by forcing the OS to do disk repair, clear caches and other housekeeping and temporarily disables third-party mods. When you're in safe boot, the machine won’t be at its best performance, especially with graphics, but that's expected.
Does the same thing happen while in Safe mode?
You can exit safe mode by restarting your Mac normally, then reevaluate the problem.