In the last few years almost every time a memory card has failed on me it’s for the same reason - the lock switch gets stuck to locked rendering the card useless, destined for the bin.
If your SD Card is not detected in the Device Manager, then this post will help you. This issue can occur due to hardware issues, outdated or corrupted drivers, faulty SD Card, faulty SD Card ...