I agree with BoraMurdar - Windows knows how to manage and maintain disks (HDs and SSDs) just fine. 3rd party defrag programs just wastes disk space.
So just let Windows manage it. More important is to keep a big chunk of free disk space available on your drives. Don't pay attention to any advice that says you need some percent of the entire drive. That's a silly arbitrary number that has no basis in fact. You often seen people advise keeping anywhere from 10 to 30% free. That's just dumb! Note with inexpensive monster drives common today like
this 4TB WD costing ~$100, that would mean setting aside a whopping 400GB to 1.2TB

of space! What a waste!
I generally recommend 20GB to 30GB, regardless the over all disk size. That is plenty of room for Windows to manage open files, temp files, the page file, and still have enough room to keep fragmentation (on HDs) in check.
TRIM
is a SSD optimization routine (which is why it is managed via Windows "Optimize Disk" feature, along with HD defragging routines) but it is not equivalent to hard disk defragmentation. TRIM is implemented as a "wear leveling" routine to distribute the number of "writes" across the entire SSD instead of just repeatedly writing to (and potentially wearing out) the same storage location over and over again. So TRIM will move file "segments" around, but it does not assemble those segments in any sort of defragged order. It just does not need to because of the way data is accessed on SSDs (electronically instead of mechanically).
So again, just to avoid confusion, SSD TRIM and HD defragging are both disk
optimization procedures, but they are nothing alike in their purpose.