There's an "unmount" button somewhere (usually in settings, maybe in storage). If you accidentally tapped that, the card will be unmounted. (That's like Windows' "safely remove" option.) You can just remove the card, then replace it, or restart the phone.
Welcome to Android Central! The SD card could be corrupt, defective, or counterfeit. Install SD Insight to see if the card is genuine or counterfeit. Counterfeit cards are programmed to report more storage than they actually have, and if you try saving more than the card can actually hold, then files can start getting corrupt. (Be aware that SD Insight might not work on all Nougat or above devices.)