If your computer is really slow, then upgrading macOS will not solve the problem, but will probably make the problem worse. If you don't have enough memory and/or free storage space on the boot drive, then your system will be extremely slow. It is also possible you have some third party software installed that is slowing down your Mac. Anti-virus apps, cleaning apps, and third party security apps can make a computer run extremely slow and interfere with upgrading macOS. You need to fix the issues causing your slow system before you consider upgrading macOS.
You didn't tell us which exact model Mac you have which can make a big difference in assisting you. It is possible you have a worn out or failing hard drive which can make a computer extremely slow.
Try running the Apple Diagnostics to see if any hardware issues are detected. Unfortunately the diagnostics don't identify most drive failures so run DriveDx and post the report here using the "Additional Text" icon which looks like a piece of paper.
To look for possible software issues run EtreCheck and give EtreCheck "Full Disk Access" so that the summary of the recent system logs are included which may include some clues. Post the report here using the "Additional Text" icon which looks like a piece of paper.
Also run Disk Utility First Aid on the hidden Container. To see the hidden Container click "View" within Disk Utility and select "Show All Devices" so that the hidden Container appears on the left pane of Disk Utility Even if First Aid reports everything as "Ok" click "Show Details" and manually scroll back through the report looking for any unfixed errors. If any unfixed errors are listed, then you will need to erase the whole physical drive and restore from a backup or clone. Some file system errors can cause a Mac to run extremely slow or even crash.
Make sure to have a good backup.
You should always have frequent and regular backups.