Please make sure Laptop or Desktop? check SATA cable and HDD power cable If its Desktop. whatever laptop or desktop its maybe HDD power cable or datacable problem. so u can change the power cable or data cable.
Note: my computer > manage > storage > Disk management > than check online status.