If there is an issue of computer not recognizing hard drive, then it may occur due to faulty connections, faulty cable, faulty USB port, partitions, or issues related to file system. Firstly, you should reconnect the HDD and use a different cable or port. Then, go to Disk Management and see if Windows is able to recognize the physical disk. If the drive gets recognized but it does not have any drive letter, assigning a drive letter may help it get recognized in File Explorer. If the drive gets recognized as RAW or unallocated, then avoid formatting it right away as some important files may still be recovered from it. It can also be connected to another computer to check if the problem is with the HDD.
Read more - https://notchox.com/resources/how-to-fix-hard-drive-not-detected/