The Age of this computer will Govern what newer version of macOS it will Qualify to install. Use About this Mac from the Apple Icon on Desktop - the required Information will be there.
With the above information in-hand - follow this How to get old versions of macOS and verify what version this computer Qualifies to install. Make sure to use Only Safari to commence the download as Others may not work. Safari will open a redirect and open the Apple Store where you can commence the download. If an error message appears, that is probably because one is using another Browser.
How to create a bootable installer for macOS
The Steps below will Wipe the Entire Drive of Everything - there is no Do Overs - period.
To perform this action will require booting from a Bootable Installer. This will have to be performed from a Qualifying Computer to run the version of macOS to be made on the Bootable Installer. Example : Bootable Installer of Big Sur would have to be done on a computer that Qualifies to run Big Sur.
Once that is done read on for preparing the Destination computer >> Special Notation - works on Intel Based Apple Computers & May on Apple Silicon M1 CPU
Extra Special Notation regarding the Touch ID equipped Apple Computer. About Startup Security Utility and Must Enable from Recovery Mode the ability to boot from External Drive Before Attempting
1 - Shutdown computer and disconnect all external drive Except the newly created Bootable Installer.
2- Restart and immediately hold the OPTION key until the Startup Manager appears and choose the USB Drive.
3 - It will present options >> Disk Utilities >> View >> View ALL attached Drives.
4 - Choose the Upper Most Drive ( not the volumes indented and list below ).
5 - The drive normally is called Apple Media or Apple SSD - that is the drive to Erase and format as FS Journaled with the GUID Partition Map.
6 - Once that is done >> backup out of Disk Utilities and choose install macOS.
7 - Follow the prompts and it may automatically reboot several time.
8 - Upon a final reboot - Setup Assist will present with the newer version of macOS.