I've been using Mac's since 1987 (not the same ones!) and currently run a fleet of about 25 of them for my business. Slowing down gradually over time is a problem with all of them, although generally less with headless servers. (IMLE it's also much less of a problem with MacOS than with Windows).
By far the most cost effective way to improve the performance is to make sure you have a good Time Machine backup, clone the hard drive to an external drive using Carbon Copy Cloner and then re-format the hard drive and install a new, clean OS. Then copy your user files back from the clone. Don't just rely on a single Time Machine backup - make sure there are at least two copies of all your data at all times.
The less stuff you copy back from the clone the better, particularly settings, application preferences and system files. If you want to save your Safari bookmarks, calendar entries, address book contacts etc. then the best way to do this is to set up an iCloud account - up to 5GB is free, which is ample for synchronising basic system data.
Don?t try using iCloud to synchronise photographs unless you only have a very small number: you will rapidly run out of space and you can?t tell which ones have been synchronised and which have been left behind.
iCloud will synchronise mail settings but not mail messages. If you have any e-mails you really need to keep then be very careful to make sure you have a backup of them, particularly if you install an updated version of MacOS as part of the disk cleaning process. Apple update the Mail program pretty much every time they issue a new version of MacOS and it?s not uncommon for the upgrade to mangle your mail folder structure. The best thing to do is export all mails as mailbox archives and then you know where they are when you want to import them into the newly restored OS.
Also be careful to ensure you know what all your important passwords are before you start. You can use the iCloud Keychain function but it does not save every password. One advantage of making a clone of the disc rather than just relying on a Time Machine backup is that it should be possible to start the machine up from the external drive which gets you back to where you started from if you find that a vital password has not been copied across.
You can use Apple?s Migration Assistant to copy the user files back to the clean hard drive, but it copies more than the minimum necessary so just copying the files you need manually is preferred if possible. Migration Assistant is a good solution if you are not familiar with how to access and copy hidden files from the user and/or system libraries.
As has already been pointed out, replacing the hard disk drive (HDD) drive in the machine with a solid state drive is the first thing to do if you have some money to spend. As already mentioned, Crucial are a good source and have an excellent part finder on their website which will help you to identify the right SSD for your machine. If you use Carbon Copy Cloner to make a clone of the old drive onto the new SSD you should just be able to swap the drives over and immediately be back to where you left off (but faster) without having to move any files manually. New SSD?s should be formatted with Apple?s (fairly) new APFS format to get the best performance.
Extra RAM also helps, particularly if you are doing anything with video files or lots of images. Again, Crucial are a good place to go.