Hey travellerva,
It can be difficult to narrow down an issue that intermittently happens. The best way to narrow it down is to take notes on when you notice it happening. Notes such as: which apps were open and being used, what task were you completing, were there any external devices connected, etc.
For this, we recommend starting with testing the issue in safe mode and a new user account. Safe mode will tell you if the issue is possibly caused by software and a new user account can tell you if the issue is system-wide or only within your account. This way you'll know better where to focus your troubleshooting.
Here's more information on safe mode and creating a new user account. For safe mode be sure to note the start up steps for if you have an intel-based Mac or one with Apple silicon:
How to use safe mode on your Mac - Apple Support
Change Users & Groups settings on Mac - Apple Support -- After creating the new user account, you’ll need to log out of your account and log into the new one.
Let us know what you find.
Take care!