You’re at the final version of macOS for that iMac 27” late 2015 model. There are no supported means to get newer macOS that far back.
You can use LibreOffice, or (existing installs of) Apple’s Pages, Numbers and Keynote, or such, as these can read or write most Microsoft documents. Google Docs (probably with Firefox) and other options can exist, as well. LibreOffice supports as far back as macOS 11, Apple’s tools will already need to already be in your purchase history, and can then be (re)downloaded.
Or replace that iMac with a newer or new Mac capable of running the three most recent macOS versions, if you want and need Microsoft apps.
In 2026, you’d want an Apple silicon Mac, probably M2 or newer.