Rover58 wrote:
The iMac also runs very slow, so maybe it's time for a new one or research the best software to clean it up and optimise the performance for a little bit longer.
Your Mac has 8 GB of soldered-in RAM. You could be running out of RAM, but I'm guessing not.
My guess is that one of the main causes of your misery is your internal drive. Unless you bought a version of that Mac that included a 256 GB flash drive (SSD), your Mac has either a slow mechanical hard drive, or a slow Fusion Drive. Late 2015 was when Apple cut the amount of flash (SSD) storage on 1 TB Fusion Drives from a respectable 128 GB to a miserly and totally inadequate 24 GB. It's prime real estate, but there is not nearly enough of it; when the 24 GB runs out, your Mac is back to storing things on a slow 5400 rpm mechanical drive.
If that drive is nearly full, performance may fall off a cliff.
A solution to this might be to get an external USB SSD, plug it into one of your USB-A (USB 3.0) ports, clone your current system onto it (using Carbon Copy Cloner or SuperDuper!), and then make it your startup drive.
I would suggest avoiding "cleaners" and "optimizers", some of which may actually make problems worse.