Working on automobiles is a tough job. A mechanic often finds that they have to put their body into awkward positions to access different parts of a vehicle. Along with that, it is a job that is rough on the hands.
In a busy repair shop, a mechanic will find that they are using their hands all day. Whether it is removing parts and putting them into place, or the steady turning of screws, or the gripping of wrenches, this is a job that can be absolutely brutal on the hands. It can lead, or contribute, to things like arthritis, carpal tunnel, and tendinitis.
For a mechanic, preventing these issues is going to come down to rest. When you have been working long hours and your hands are starting to get sore, take a break. When you are off from work, let your hands rest. As an additional point, you can learn stretches and exercises that can help to build the strength in the hands and relieve the pain.
To address pain that is current, you can use options like ice and extended rest. Beyond that, you may need to consider changing some of your work habits, try wearing a brace or try to find a topical pain reliever that works for you.