If the laptop is running extremely slow either you have a software issue or the hard drive is worn out or failing. You can check the health of the hard drive by running DriveDx and posting the report here using the "Additional Text" icon which looks like a piece of paper. If you are using a hard drive as opposed to an SSD, then any "Warning" or "Failing" notices from DriveDx indicates the hard drive is worn out or failing respectively and should be replaced with an SSD which will allow the laptop to run a bit faster than it did with a slow hard drive, but you do need to be careful with which SSD you use (Crucial MX500 series or an OWC Electra 3G SSD are most likely to be compatible), but only you can decide if it is worth investing any money into this laptop.
You can create a bootable macOS USB installer using the instructions in this Apple article:
https://support.apple.com/en-us/HT201372
Also here is what you should do when getting rid of an Apple computer. Keep in mind the instructions in this Apple article assume either you are using an SSD or you have Filevault enabled if you are using a hard drive in the laptop.
https://support.apple.com/en-us/HT201065