Thanks for the help sofar treekram!
just wondering whether or not reinstalling osx would solve the issue too as i was about to go buy a harddrive to backup my mac onto.
It's possible that the kernel extension got corrupted somehow. If you install over the current OS (without erasing the drive), it should fix it if the kernel extension or other OS file got corrupted. But if you already have installed the High Sierra Security Updates that have come after 10.13.6, I'm not sure how it handles that - if it allows you to install 10.13.6 over it or if you have to re-apply the Security Update or what. But an OS install does exercise the SSD quite a bit and I wouldn't try that unless you have a backup.
Have you been able to try using safe mode for a longer period of time?
When the 2015 MBA first came out, it would very likely had an AHCI SSD (AHCI being a protocol). When Apple replaced your SSD, they replaced it with a NVMe SSD. There's no big disadvantage either way - both likely would have been Samsung drives sold to Apple as OEM hardware with very little difference between them. The NVMe variant is unusual and after writing my first reply (post #2), I saw a reference to Apple NVMe SSD's that were put in some later MBP's. Some people are saying that the NVMe drive can be used as an AHCI SSD which then would not require the NVMe kernel extension. However if there's something else wrong with the SSD, then it probably would matter whether it's running as NVMe or AHCI. Again - this type of Apple SSD is unusual. And so that's why I gave my advice to so see Apple.
You have choices in how you do your backup. You can certainly use Time Machine and it has the advantage of already being on the computer. A lot of people, including myself (I've just recently started using it) using "Carbon Copy Cloner" (CCC). You can download a free trial copy from
https://bombich.com/
If your SSD is having problems, it's best to do the backup as quickly as possible. But the advantage of making a backup with CCC is that you have a bootable OS disk. With the bootable OS disk, it would be possible to boot from the HDD, unload the kernel extension (which is at /System/Library/Extensions/IONVMeFamily.kext), reboot again from the HDD and see if the internal SSD is recognized. If it is, then it's likely that the SSD can run as an AHCI drive. Again, if the problem is the SSD, I don't know that running in one mode vs. the other would make a lot of difference.
UPDATE: Whatever backup method you use, make sure the HDD is formatted to Mac OS Extended (Journaled) with the GUID Partition Map (the last example in the following link) before doing the backup.
https://support.apple.com/en-us/HT208496