If you find any "Install macOS..." file in your Applications folder, delete that and then try to download the installer again.
The macOS version you can upgrade to depends on the year your Mac was released.
Click the Apple menu () at the top of your screen and choose About This Mac.
✅ Check the compatibility of your Mac hardware with newer versions of macOS software:
➡️ macOS 14 Sonoma is compatible with the Macs listed here (c.2018)
If your Mac is compatible with the OS upgrade, then this:
Update macOS on Mac - Apple Support
Alternative Method–
➡️ Download the macOS upgrade installer app:
Click > macOS 14 Sonoma.
Once downloaded, double-click the “Install macOS…” app now found in the Applications folder to begin the upgrade.
Please see > How to download macOS - Apple Support.