I was trying to establish if the problem recurs if you insert the same plug in a different socket (I presume whatever device you are connecting to has more than one USB socket?).
If the problem moves to a new socket, it is likely that the USB lead you are using has a faulty connector. If the lead is detachable at both ends, try a new one - you can buy them. If it is captive to the external drive, then you have a problem, that may be solved by purchasing a new empty enclosure, and opening up the faulty one and transferring the hard drive.
If the problem goes away when you move to a new socket, then it is likely that you have a damaged or marginal socket.