If you've determined that your drive has a mechanical problem, you may have some difficulties to overcome. The drive might be fixable and your data recoverable, but it might require a professional repair, which can cost hundreds or even thousands of dollars. The main reason for this is that work on the internals of a hard drive have to be done in a "clean room" environment. Any piece of dust on the platters can ruin the drive.
You could attempt a mechanical repair on your own, but you'll need to find exact replacement parts from the exact model and version of the drive. This can be a huge challenge all by itself (even for professional data recovery experts). You might be able to replace a dead circuit board yourself, but spindle motors and read/write actuators are very difficult to deal with. Also note that opening your hard drive's case will void its warranty. If you do decide to go this route, remember to never touch the platters themselves. The oils from your fingertips are enough to ruin the drive.
A problem with a corrupt file structure or disk index is solved with special software. There are some utilities, such as fdisk, built into most operating systems that can be used for this purpose, but you have to be very careful. Changing the partitions in the drive or formatting it might solve the problem, but you'll lose all your data. Another option is to use a specialized recovery utility such as Disk Warrior to repair the problem while keeping as much of your data as possible. Some corrupted files may not be recoverable.
Up next, a look at some extreme forms of hard drive repair.