dd will not work with a failing drive, as it will just block onthe first error.
do not try to mount any partition of a failing drive as you will end up with doing more mess
do not try to fix filesystem ona failing drive as you will lose more data.
do not do anything before you are really sure you are doing it on the intended drive as it is easy to format the drive you want to save or dd / ddrescue the wrong way !!!!
As I said use
ddrescuebuy a new hard drive same size or geater install it, this will help to transferthe data to it (beware same size or greater, ie some X tb size drive some will be few octets smaller than other, if the new one is a little smaller it will fail).
note serial number of old drive and new drive from their afixed label
find ausb key you could mount to save the log
boot with a rescue cd containing ddrescue, do not choose to mount partition automatically
first check which drive is which
smartctl -a /dev/sda
smartctl -a /dev/sdb
smartctl -a /dev/sdc
from there I assume
sda is old drive
sdb is new drive
sdc is usb stick
you will have to adapt for your situation ...
mount usb drive
mkdir -p /media/usb
mount /dev/sdc1 /media/usb
cd /media/usb
launch backup at low level ; without retrying errors, so you will save all what is still good before it fails more.
this could take few days to run
ddrescue -f -n /dev/sda /dev/sdb /media/usb/rescue.log
then when it finish you could try to scrap more the dead zone or decide you are happy with that
trying more (try 3 times on skipped block and tag them as bad after 3 trials).
it could take more days to scrap a few 16 MB of failed data....
ddrescue -f -r3 /dev/sda /dev/sdb /media/usb/rescue.log
then simply remove old drive and try booting on new, simply mount the new drive partition and get your files.
store the old drive and do not touch it anymore untill you are happy with all important files restored.
as suggested by Stefano it would be good practice to clone this second drive to a tird before trying to repair to keep the original dat in case trying to repair make more mess.
depending on the result you could just copy the files and reinstall on a new drive, or just run the new drive after quick fschck
advanced users will use the ddrecue log file to detect which files are wrong... will need some advanced scripting and might depends on filesystems on partitions.
manual :
https://www.gnu.org/software/ddrescue/some reference trying to know which files are corrupts depending on sectors failed (there are few other methodyou can find on the internet) :
https://tim.purewhite.id.au/2011/04/disk-recovery-which-files-are-damaged/EDIT: as showed by Stefano with dd, you can use a bigger drive and output in a fileblock instead of directly on the drive. you can also ddrecue one partition at a time to fileblock... see the documentation of ddrescue