WD Elements Portable 2TB not detecting

Hi,

I bought a 2tb WD Elments in 2017. There is error detecting the HDD now. Sometimes it is detecting, sometimes not. I think there is an issue with the cable. After connecting, it won’t be detected. When I try push the cable, it sometimes detects. When I release my hands from the cable, it is getting disconnected.

What can I do? Can I get a new cable and will it fix the issue?

Thanks