How to Repair a Remote Key
Even though most remote key fobs boast amazing battery life, they will eventually wear out. Sometimes it's as simple as changing the batteries, but sometimes there are more serious issues.
A quick fix that can aid is to disassemble the remote, cleaning the buttons and flexing them in and out. These steps could be all you need to get your key fob working.
Battery
If the fob is still working you can replace the CR2025 or CR2032 battery. If it isn't accessible, you can take it off the fob and inspect the battery terminals and buttons for any signs of looseness or damaged parts. Most of the time, the buttons and terminals can be repaired by soldering them back into place, but you'll need to be aware of the kind of battery the fob is using.
If the battery isn't the issue Try using an alternate key fob to see whether you are able to start or unlock your vehicle with it. If it's possible do so, it's probably time to replace the primary fob. If not, a professional check is necessary to determine the reason it's not working correctly. It could be as easy as reprogramming it, or require different types of repairs. You may also find that your car has lost the fob. This is not something you can do by yourself.
Case
The case of remote keys is the outer plastic housing and usually comes with the button pad replacement. It is essential to choose a new case as the original one is likely to be a bit shabby and it is vital that the circuit board is set correctly in the case. The circuit board is responsible for the function of the key fob and is tested using a normal multimeter by setting it to the RF (radio frequency) mode and holding a radio scanner tuned to the frequency the key fob uses next to it, watching for pulsing signals upon button presses.
Examine the contact points of the buttons on the keypad. They could have become loose over time, or even broken. Soldering them back in place can often restore them to their original function, unless they break completely.
Buttons
If the buttons on your key fob aren't working anymore or are difficult to press, you can buy an alternative dorman or Motormite remote key housing online at the lowest price for your model/year/make. Then pop key repair from your old case into the new one. In some cases it may be necessary to move the board slightly. You can then apply aluminum foil with double sided tape to adhere to the black contact points on the buttons.
Programming

The key fob and receiver inside your car are paired however this connection could be corrupted. A professional will assess your car to determine its make, year, and model. They'll then use special equipment to reconnect or program an unmodified transponder chip or fob (or clone the key if possible). Then they will test the remote to make sure it functions.
It is important to be cautious when programming an unprogrammed key, since the process can be a bit complicated and different manufacturers have certain steps that are slightly different. It is also easy to miss a step or wait too long before exiting the programming mode, therefore it is best to use an expert with a thorough understanding of the security system of your vehicle to avoid damaging the car. Certain programming tools that are essential to use can also identify diagnostic trouble codes in your vehicle. This will help you fix or resolve other issues.