HTC one M8 doesn't recognize SD card

A

AC Question

I bought a 64gb SD card for my HTC one M8 to put all my music and pictures on because I needed more than the 16gb my phone had initially. I've had the card for about three-four months now and all of a sudden my phone didn't recognize the SD card anymore, and I can't find any of my music or pictures (videos) anywhere. When I plugged the phone into my pc I managed to locate the internal storage, including everything that I hadn't transferred onto my SD card, but not the SD card or any files on it. Is there any way I can recover the lost files or make my phone recognize the SD card again. It'd be great if someone could help me out.