Hello dimi1127,
In order to isolate the issue a bit, please restart your Mac in safe mode. Here’s how: How to use safe mode on your Mac - Apple Support
We want you to be aware that restarting in safe mode may take a bit longer than usual since it prevents some software from loading and does a check of your startup disk. You may also see some graphic anomalies on your screen as well.
After testing the issue in safe mode, refer to the sections below from the article we shared above:
If the issue continues in safe mode
If the issue continues in safe mode, the easiest and most likely solution is to reinstall macOS. Reinstalling macOS doesn't remove your personal files, so you can do it whenever you need to.
If the issue doesn't continue in safe mode
Leave safe mode by restarting your Mac normally, then try to reproduce the issue. If the issue doesn't return, it might have been resolved by the other things that safe mode did at startup, such as checking your disk and clearing caches.
If the issue returns, it is caused by a login item or other software that safe mode prevents from loading at startup. In that case, remove login items to find out whether a login item is at fault.
If a login item is not at fault, your user account might contain other software that is incompatible, including certain software that loads at startup. To confirm, you can add a user account in Users & Groups settings, then log in to that account and test again. The new account won't have the same settings as your old account, but you can create those settings again.
If nothing else works, reinstall macOS. Reinstalling macOS doesn't remove your personal files, so you can do it whenever you need to.
We hope this helps. Let us know if we can assist with anything else at all.
Take care.