Well, it's hard to give that specific an answer with the information given. What does "starts to work" mean? Is the hard drive readable at all? Is the problem when you're trying to transfer a file or when it's trying to be read at all? Was it giving you any trouble before? Is the drive making any particular sounds? Have you used any diagnostic tools to look at the hard drive? Does it happen constantly or intermittently? Is the hard drive detectable in Windows still?
So at this point, rather than play 20 Questions and try to coax information from you, I'll just give you very general advice. I'd use an alternate SATA cable first, the easiest possible solution. If that didn't work, there are a couple paths I'd go.
If I had been backing up my files, the next thing I'd do is try to format the hard drive and re-check the status. If a format failed then I'd RMA the hard drive or recycle it.
Now, if I hadn't been keeping up with my backups, I'd try more things to recover my data. I'd start with a software solution like Recuva. Then I'd try it in an USB enclosure and see what I could get off of it in this PC or another one.
When these efforts fail, you then have to decide if the data on the hard drive is valuable enough that you're willing to spend the $1000-and-up that a good data recovery firm can cost you (which is why a backup solution is a very basic part of PC upkeep if you have data worth protecting).