It sounds like you are talking about a USB stick which has failed. USB sticks are very untrustworthy and are not meant for storing permanent copies of your data. They are meant for quick and easy transport of data between two machines. I've had issues even with well respected name brand USB sticks. Inexpensive off brand no name USB sticks are even worse and I won't touch them.
You should always maintain good verified working backups so that you have multiple copies of any important data.
It sounds like the USB stick has a hardware failure. Your only option is to contact a professional data recovery service such as Drive Savers or Kroll Ontrack. Both of these vendors are recommended by Apple and other OEMs and both vendors provide free estimates.
If the "flash drive" is actually an SSD, then my advice still applies. SSDs even from respected name brands can fail without any warning. Backups are essential in preventing the loss of critical files. Multiple backups are recommended.