When working on any electrical component on the vehicle, it is always a good idea to disconnect the negative (-) battery cable. This will prevent potential damage to many sensitive electrical components such as the Engine Control Module (ECM), radio, alternator, etc.
Before you disconnect the cable(s), first turn the ignition to the OFF position. This will prevent a draw on the battery, which could cause arcing (electricity trying to ground itself to the body of a vehicle, just like a spark plug jumping the gap) and, of course, damaging some components such as the alternator diodes.
When reconnecting or installing a battery, always attach the negative cable LAST . This is done as a safety measure, should a tool or component slip while installing the positive battery cable. If the tool touches the battery positive terminal and a chassis ground simultaneously, as long as the negative battery cable is not connected, no damage will occur. Make sure when installing a battery that the positive battery cable is fully installed and tightened before installing the negative battery cable.
When the battery cable(s) are reconnected (negative cable last), be sure to check that your lights, windshield wipers and other electrically operated safety components are all working correctly. If your vehicle contains an Electronically Tuned Radio (ETR), don't forget to reset your radio security code, the radio station presets, and reset the clock.