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. Safe mode will often correct weird software behavior by forcing the OS to clear caches, do disk repair and other self-maintenance and housekeeping and temporarily disables third-party mods.
How to use safe mode on your Mac - Apple Support
TIP - Use a wired USB keyboard for this. If you have the Magic Keyboard, plug that into the Mac with its charging cable. A wireless keyboard may not respond quickly enough to invoke safe mode.
Does the problem go away in Safe mode but return after a normal restart?
If so, this may indicate an OS conflict with one or more of your apps.
I hope your data is backed up. If not, then this would be the time to do that before proceeding.
Back up your Mac with Time Machine - Apple Support
Next, if safe boot has no appreciable effect, I suggest that you boot your Mac in macOs Recovery and run Disk Utility > First Aid on the startup drive.
Yes, this should be non-destructive to your data, but one never knows when real trouble may strike. Hence the timely backup.
• How to start up from macOS Recovery - Apple Support
• How to repair a Mac storage device with Disk Utility - Apple Support