My SD card which has been working on my phone for weeks suddenly comes up as unavailable and needing to format I don't want to format it because it has a lot of information that I need how do I get it back online
It depends. It could actually be an app on the phone that is the cause. Or it could be the port and not the card. Have you tried turning off the phone, removing the card, then reinserting it and turning the phone back on? Should that not work, try connecting the SD card to a different device and see if it will be read. As long as it wasn't formatted to be "Internal" storage, any device should be able to access it.
If it still won't, work on any device, then the card may be toast.