iMac Regularly Hangs with Finder Not Responding
So I've had this iMac (Retina 5K, 27-inch, Late 2015 - v3.2 GHz Quad-Core Intel Core i5 - 16 GB 1867 MHz DDR3) for a while, purchased second-hand from it's first owner and for the past year I've noticed the system hangs relatively often, with Finder not responding and whenever the pointer is on the desktop, it's the spinning beachball. Sometimes I can relaunch and it will be OK for a while, but more than often it needs a hard reboot as stops responding completely and even if I can get it to Restart, it won't complete.
If I switch off when I've done what I need, it is OK for a while each time, but if left to go to sleep, when it comes back, it quickly starts playing up.
It originally had 8GB RAM, so I upgraded to 16GB to see if that would help, but it hasn't.
Is there anything I can view to understand where the issue lies? When it works, it works well and I regularly back up to TimeMachine, so if I had to replace it, I'd be able to recover everything, but obviously I'd prefer to see if it's something that can be fixed first? This also happened with Mojave and has been consistent with Catalina, so I won't be surprised to find it's hardware related?
Many thanks
Martin
iMac 27", macOS 10.15