An M4 iMac client of mine called after he spent several hours on the phone with Apple trying to fix this about 2 months ago. Apple created a new user account but it didn't help.
About 6 weeks ago, I pounded on this problem with EtreCheck Pro in Sequoia 15.4. Just to review, in the middle of working the iMac would freeze and beachball for 5-15 seconds. This happened frequently during the day and made it nearly impossible for my client to work.
TRIED STUFF (6 weeks ago)
EtreCheck Pro’s reports guided me to a blanket approach: reindexed SpotLight, reset the lsd db, deleted ShortCut app because a related daemon crashed it, unplugged a very old USB hub, deleted TimeMachine localsnapshots, ran DiskUtility on all SSD partitions, deleted user library caches folder files, reset Bluetooth because its related daemon crashed, unchecked all Spotlight category settings because a related background process had high-ish cpu usage.
I told the client to add a SpotLight category back one at a time only after a couple of days of no intermittent freezing.
One or more of the above fixed it temporarily.
PROBLEM RETURNED
The client said the problem slowly returned over the last 6 weeks to the point its hindering his work again.
I asked him what SpotLight items he added back (check boxes in SpotLight settings). He said he didn't add any back and left them all unchecked as I left them. That was a key piece of info.
I wondered what type of program other than Spotlight, which is completely unchecked, would gradually make the problem return? Maybe a memory leak in an app. I told him to update his Mac to 15.5.
The problem persisted.
SEEMING FIX (5 days ago)
So what feature gradually grows output as a feature besides cache files?
TimeMachine localsnapshots, if you have TimeMachine enabled. This M4 iMac has a 2TB internal SSD that's half full, so TM has its way spewing localsnapshots over the remaining 1TB "free" space.
So I deleted localsnapshots again. ( Terminal: tmutil deletelocalsnapshots / )
I kind of hate localsnapshots and wish Apple would let users turn them off while keeping TimeMachine running just on external drives. In hundreds of Macs I service, the only time a client needed a localsnapshot was after they lost their external drive but localsnapshots didn't go back far enough and were useless.
Plus, DiskUtility FirstAid often finds problems with one or more TM localsnapshots. It's much faster to delete them before running FirstAid. Plus localsnapshots are a privacy issue because they contain files you deleted probably without realizing that they’re still in localsnapshots until localsnapshots churn over.
But I digress.
REPORT (yesterday)
Five days after I deleted localsnapshots on the M4 iMac, the client reported that the problem hasn’t returned. That's twice in 6 weeks that deleting localsnapshots stopped the problem.
But I expect it’ll gradually return as TM localsnapshots accumulate, so I’m going to show the client how to delete localsnapshots without my help.
My client wanted to disable TimeMachine in order to disable localsnapshots but I can’t risk him not having backups.
I just tested a macOS Shortcut app shortcut for deleting them: in the Shortcut app: settings / advanced - allow running scripts, then in the app not settings choose Terminal, then Run Shell Script, then replace “echo Hello World” with "tmutil deletelocalsnapshots / “ (without the quotes; you don’t need to press return and it doesn’t need sudo).
Right-clicking (or 2-finger tapping) the shortcut in the Shortcuts app lets you rename it and Add to Dock.
Just to review not in Shortcuts but just in Terminal:
List localsnapshots, type tmutil listlocalsnapshots /
(then press return)
Delete them, tmutil deletelocalsnapshots /
(then press return)
In the Shortcuts app I only used the delete command.
I'm not thrilled about enabling "allow running scripts" because it lowers security, but I'm just doing it for this one client.
And I’ll also put the Terminal app on the iMac’s Dock and show my client how pressing the keyboard's up arrow shows the last command, likely tmutil deletelocalsnapshots / , so he can just press return to run it. If he's ok with that I may delete the shortcut and disable “allow running scripts.”