This is an issue, or was at the time of testing:
Top Processes Snapshot by CPU:
Process (count) CPU (Source - Location)
photoanalysisd 97.80 % (Apple) ⚠️
EtreCheckPro 12.58 % (Etresoft, Inc.)
WindowServer 4.40 % (Apple)
mdbulkimport (2) 4.40 % (Apple)
mds 1.54 % (Apple)
This outside article show how to deal with that:
https://apple.stackexchange.com/questions/310594/what-is-photoanalysisd-and-why-is-it-using-77-of-my-cpu
A big +1 on MartinR's information on so-called "cleaning" apps. Apple built elegant, automated self-maintenance routines into macOS over 20 years ago. They nicely take care of ALL needed housekeeping and tidying up, including defragging, without your having think about it.
Macs—cat-like—clean themselves. Adding that extra stuff only interferes with what you paid Apple to include in the OS.