As your mac is running mac OS X Mavericks 10.9.5 it should be able to upgrade directly to macOS Catalina
read Section 1 in the link below,
How to upgrade to macOS Catalina – Apple Support
Check compatibility
If you’re using one of these computers with OS X Mavericks or later,* you can install macOS Catalina. Your Mac also needs at least 4GB of memory and 12.5GB of available storage space, or up to 18.5GB of storage space when upgrading from OS X Yosemite or earlier.
MacBook introduced in 2015 or later
MacBook Air introduced in 2012 or later
MacBook Pro introduced in 2012 or later
Mac mini introduced in 2012 or later
iMac introduced in 2012 or later
iMac Pro (all models)
Mac Pro introduced in 2013 or later
As you have already tried this and it stalled, how long did you give it, you need to be patient.
If it hangs for a very long time it maybe because the installation is trying to convert your macs disk
from the older HFS+ file system to the newer APFS file system which Catalina runs on.
When you tried to upgrade the last time did you see any screens mentioning a firmware upgrade.
If you are still not getting any further with Catalina you could try the intermediary step of upgrading to
High Sierra.
I am mentioning upgrading to High Sierra as it was the first macOS to use the APFS system and
should give you instructions on how to upgrade the firmware.
Open Safari and click on this link, How to upgrade to macOS High Sierra - Apple Support
again go to Section 4 and click on Get macOS High Sierra.
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 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.