Technically I see nothing wrong with your computer, however you have a base model 21.5" iMac from 2019 which unto itself has a problem in that it uses a 5400 RPM HD which is glacially slow and is the primary bottleneck of the computer. As it is a 2019 and likely still has life in it I would recommend buying an external SSD (I'd suggest the OWC Envoy Pro EX Thunderbolt 3 ) and use the external SSD as your startup drive. You can learn how to do this in How to setup an external SSD as your startup disk which is really pretty simple if you just read and methodically follow the steps. The whole project will take about 3 hours, most of it the computer is doing its thing while you can be eating lunch.
If you don't want to take on the project you can either take the machine to an independent Apple Authorized Service Provider or it's time to buy yourself a new Mac, all of which come with SSD's now which dramatically improve reliability and speed over old spinning HD technology. Something to consider is an Apple Refurbished Mac mini with a new display. For labout $1000-1200 you can have a MUCH MUCH better solution than your 2019 21.5" iMac.