Slow and laggy Macbook Air 13" mid-2012 (A1466) I've had it since it first came out and they're finally starting to give way. Maybe it's because I was rough with them, but I hoped they last me a little longer (or at least until after university). I use them mostly for work now (Microsoft Office and Adobe Photoshop) but I did game on them lots when I was younger, so that's probably where the damage comes from.
Its performance now:

It stops 3/4ths of the way in the loading screen, it takes 30 mins to boot up.
Even after it's booted up, applications take ages to load and the cursor lags hard. Typing takes a while too.
More than half of its RAM is empty, trash is empty.
Did Apple diagnostics and EFI/Drivers/TestSupport.efi can't be loaded.
The battery appears as an &quot;X&quot; and won't last a second without a charger plugged into it.

How should I go about fixing it? Where should I get the parts? I'm not really in a position to send it to repair -- I do want to learn how to fix issues should they happen again.
Thank you very much. Any help would be very much appreciated.
The general process I have for rehabilitating old hardware is a complate wipe.

Back up to Time Machine via USB or FireWire local drive. (Optional)
Connect to ethernet (WiFi can be slow and spotty)
Boot to internet recovery and erase install

Before I load anything I repeat all!the tests with clean installs of only a few apps.
In your case, the battery is likely the biggest problem since all Apple devices with glued in batteries depend on a healthy battery for full performance. The AC power supply can’t provide burst current needed by the CPU and GPU so performance is lower without a healthy battery.
Next likely is the storage is failing or throwing errors. Macbook Pro incredibly slow/laggy