Try changing the drive cable to something of higher quality.
Also, if this is a 2.5" laptop class drive that is powered by the computer, you might try using a powered drive dock - one that gets its power from an ac adapter.
If you have other devices connected to the computer, you can try disconnecting all of those for the time being to see if that is helpful. Sometimes having too many devices on the connection bus can create a scenario where those devices try to pull more power than the compute can provide.
If you continue to have trouble, you might want to run a drive utility to see if that drive is having some hardware or directory problem. You can take a good look with DriveDX by Binary Fruit.
Directory issues can often be corrected by running Disk Utility's First Aid routine on the drive and its various volumes. How to repair a Mac disk with Disk Utility - Apple Support