As rkaufmann87 has posted, your 2013 iMac cannot be upgraded to macOS Sonoma.
The newest version that it can run is macOS 10.15.7 Catalina.
Though you can't upgrade the machine's OS, you can still use it productively. You can continue to run any of the software that is installed. It can still be used for your music, photos and video libraries, email, games and other entertainment, word processing, calendar functions, etc.
You will probably find that internet access becomes more and more problematic because the browsers are no longer supported and updated, but the computer will continue to do its thing until it doesn't.