Mavericks is no longer available for download, it may still be available from Apples Recovery Servers.
I would start with Mac OS X El Capitan (10.11.6), you can download it here.
How to upgrade to OS X El Capitan – Apple Support
Go to Section 4 and click on Download OS X El Capitan.
This downloads InstallMacOSX.dmg to your Downloads folder.
The next section can only be done on a mac that is capable of running El Capitan,
a mac that came preinstalled with an OS later than El Capitan will refuse to do the next bit.
When downloaded open to InstallMacOSX.pkg, double-click on
that and an installation window will open, this does not install El Capitan
but converts the InstallMacOSX.pkg to the Install OS X El Capitan.app which
you will find in your Applications folder, it should be 6.2GBs in size.
(If the installation window asks which disk you want to install to, you must pick
the disk that you are booted to at the time. Not any internal or external disk that
you want to eventually install El Capitan on, that is for later.)
Create a bootable USB installer disk using the Install OS X El Capitan.app
in the Applications folder and the createinstallmedia command in the Terminal app.
Read the instructions here,
How to create a bootable installer for macOS – Apple Support
After that you can consider upgrading further, I would recommend going to macOS High Sierra first
as this should allow you to download and install the firmware necessary to convert the file system
from HFS+ to the newer APFS which the modern OS's are optimised for.
Please use Safari to access the following links do not use Firefox
How to upgrade to macOS Mojave - Apple Support
How to upgrade to macOS High Sierra - Apple Support
Before upgrading make a full back up of your Mac.
Check that third party apps you use have updates available for the new OS.
https://roaringapps.com
Check that your printers/ scanners etc have updated drivers and software available for the new OS.
Connect your mac to your router via cable rather than rely on WiFi.
Do not use your mac while it is downloading
and do not use any other devices that share the same internet connection.
If the App Store says ‘Open’ then it is detecting a previous download of the install app
go to the Applications folder locate Install macOS ******.app.
Move it to the Trash, empty the Trash.
Restart, click on the link again, the App Store should say ‘Get' or 'Download'.
If you are considering upgrading to Catalina be warned that it does not support 32bit apps.
Your Mac is probably running 32bit apps and these will need to be updated to 64bit apps,
some updates may be free, some may be paid. Use this app to discover which apps you have
are 32bit, https://www.stclairsoft.com/Go64/. Once the list has been created you can then
contact the developers of the apps to see if they provide 64bit updates.
How to upgrade to macOS Catalina – Apple Support