Open the Apple Menu in the top left, select About This Mac, and post up the model year for your specific model of iMac.
An iMac of late 2009 and newer can be upgraded to High Sierra 10.13 at no cost, assuming sufficient memory and free space.
An iMac of late 2012 and newer can be upgraded to Mojave 10.14 at no cost, again assuming...
An older iMac can top out at El Capitan 10.11, and yes, you’ll be missing the enhancements in newer macOS releases.
It’s possible to avoid some of the browser messages around older security for a while, but that’ll get increasingly difficult as the other web browsers stop supporting the older releases.
Most folks get into trouble here with stuff they’ve added; free apps, optimizers, add-on security tools, add-on cleaners, fake Adobe apps, cracked apps, etc. And removing Flash Player (as was mentioned) and removing Java if either of those are installed (and are not being used) are common choices, as those apps have had various security problems, as well as being confusing around the fake pop-ups for installers and updates.
The biggest part of security that gets missed far too often are backups. Complete, current, automated, and preferably with some redundancy. Backups are your path to recovery from a breach, or from damage, or from hardware failures.