I highly recommend checking the health of the hard drive before doing anything else. If the hard drive is failing, then attempting to use normal utilities to attempt to retrieve the files will usually make the failure worse to where even an expensive professional data recovery service will be unable to recover any data.
You can check the health of the hard drive by creating and using a bootable Knoppix Linux USB stick. Download the Knoppix v8.6.1 or v9.x DVD (one with "EN" in the name for "ENglish") version and use the Knoppix .iso file as a source for Etcher (Mac/Windows/Linux) which will create the bootable Knoppix USB stick. Option Boot the Knoppix USB stick and select the orange icon labeled "EFI". The Mac may appear to be frozen on the Apple boot picker menu so give Knoppix lots of time to finish booting. If Knoppix boots to the desktop, then click the "Start" menu icon on the lower left of the Taskbar and navigate the menus to "System Tools --> GSmartControl". Within the GSmartControl app double click on the laptop's hard drive icon to access the drive's health report. Post the complete health report here so I can see whether the hard drive is healthy or how bad the failure may be as that will affect the advice to attempt to retrieve files. If Knoppix only boots to the command line, then let me know as I can provide easy instructions to retrieve the drive's health report.
If Knoppix won't boot the laptop, then you will need to remove the drive to connect it to another Mac using a USB to SATA Adapter, drive dock, or enclosure. If you notice the drive is not responding correctly, then you should check the health of the drive by using DriveDx and posting the complete report here using the "Additional Text" icon which looks like a piece of paper. You need to install a special USB driver to attempt to access the health information of a drive connected by USB. However, even with the special USB driver some USB adapters, drive docks, and enclosures do not allow the necessary communication to access a drive's health information which is why I suggested using Knoppix to attempt to check the health of the drive while still installed internally.
As another test you can remove the hard drive from the laptop and attempt to run the online Apple Diagnostics again to see if the diagnostics will finish. This may tell you whether the laptop has the issue or whether the issue is with the hard drive (or drive cable).