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.
And in your case - Strongly Suggest upgrading the High Sierra First as there seems to be issues jumping from Yosemite directly to Big Sur. Once High Sierra is installed and functional - do a Time Machine Backup and then upgrade to Big Sur.
Tips How to Upgrade to Big Sur worth reading before the final jump to Big Sur
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 Other may not work
Make a Time Machine Backup Before attempting. Notation - Mojave is the Last version to support 32 bit applications / extensions and Drivers. Catalina and Big Sur Only support 64 bit and there is no workaround.
Are there any AntiVirus, Disk Cleaner, Optimizers, Defrag, VPNs etc installed which should be removed as per Developers Instructions. They are useless, unneeded, cause havoc and interfere with the normal operation of the OS and may even Corrupt the OS requiring a Reinstallation.