Just do a quick search in Apple Support Community, you’ll find tons of optimization tips - though many aren’t really that helpful. Reasons behind a slow Mac vary, so are solutions to tune it up. Over time, the main drive of your machine accumulates all kinds of files that can slow down macOS, especially the latest macOS version requires more disk storage and RAM.
Is your Mac machine running a bit slowly? Does it hang up more often? MacBook, iMac, it doesn’t matter.