It depends on how important the contents are for you.
There are more sophisticated recovery software that might be able to recover stuff from the drive. And there are specialists in these sorts of things. It costs $$$.
On the other hand, drives do fail. And if it is failing, I would not trust this drive.
Of course there could be some other reason why it is not working, and it may be that after reformatting it will work.
This is a good reminder to always have backups!
To reformat, select the whole drive in Disk Utility and click Erase. Choose Mac OS Extended or APFS with GUID Partition Table (usually Mac OS Extended is still preferred for hard drives, and APFS for SSD).
Or, if you need to use this drive on mac and pc, format it as ExFAT with Master Boot Record.