There was a time when you could speed up the Mac by running a defrag and optimize tool. Not all tools will do both, and if both aren’t done, the speed improvement may not be realized. So that was then, with the older versions of macOS X. What about now? The latest file system is now APFS. The APFS file system does an intelligent defrag that works in the background, and this may still require that your computer is not turned off or put to sleep. There are two sleep modes in macOS X. One is to put the display to sleep, and the other is to put the computer to sleep. Check System Preferences -> Energy Saver. It’s okay to allow the display to sleep. If you want to ensure that the computer has plenty of time to perform, don't let the computer go to sleep.
John R. Carter, Sr.