I'd say never. "Optimizing" typically means killing apps in the background, which really does nothing overall, since the system will restart apps automatically to fill RAM. It will also probably clear all app caches, which is fine if you're running low on internal storage (which is unlikely on a Note9), but this will slightly impact the performance of your apps, since they rely on cached data to start up and function more smoothly.