Suggest Start up your Mac in safe mode and choose the method appropriate for this machine. Safe Mode will do a Repair Disk, clear cache files and only load Apple Software, extensions and fonts. All this is done behind the scenes and requires not user interaction. The loading process will be slower than normal - that too is normal. Once logged in - the computer will look and perform differently - that s expected. If possible - run this way to as log as it would normally take for the computer go into Screen Safe Mode. Then test if this behaviour repeats or not.
Should the issue happen in Safe Mode - there might be a User Account issue. If the issue does Not happen - there could be some Third Party Software installed and causing your issue.
Should the issue appear to be Third Party Software -
Suggest downloading the Application Etrecheck directly from a Trusted Developer and well Respected ASC Contributor. The application is free or paid from added features. Run the application with Full Disc Access ( Security & Privacy - Full Disc Access ). It will take a Snap Shot - both the hardware and software. The Report will Not Reveal Any Personal Information. Post back the Full Report - copy and paste - using the Additional Text Icon ( 3rd Icon to last )
We can have a look at the report for possible issues and may have possible suggestions to resolve the issues.
Any Third Party Applications that will interfere with the normal operation of the OS, alter, modify, remove or delete or attempt to do so is an invitation for disaster and may require a Reinstallation of the OS.