Disconnecting and Connecting Your Battery
If you're going to do any work on your car involving the electrical system, disconnect the battery first. To do this, loosen the connector for the negative/ground terminal first, and wiggle the terminal cap off. Use a wire-tie or similar to tie the cable back out of the way. If you need to take the battery out, you can now take off the positive connector.
Why negative then positive? If you disconnect the positive side of the battery first, the negative side is still connected to the entire car. If you drop a tool and it lands on the positive battery terminal and touches anything else on the car, you'll have an electrical short. By disconnecting the negative first, you're cutting off the return path for the current. Now, if a tool drops on to either of the battery terminals, it doesn't matter if it touches part of the chassis or not - there's no continuous path for the electrical current.
Reconnecting your battery. Connect the positive terminal first, and the negative second - the reverse of removal, and for the same reasons. When you slip the negative connector on, there will be a spark as it gets close and makes contact with the negative battery terminal. Don't be afraid of this - it's nothing to worry about. Make sure the terminal caps are done up nice and tight.
CHECK YOUR BATTERY TERMINALS
Most modern cars run on a 12 volt negative ground electrical system. If your battery terminals or contacts aren't clean, you're making it more difficult for the current to pass around the electrical system. Remove the terminal caps as described above and clean each contact post with a wire brush to get a nice clean metal contact surface. Do the same to the terminal caps, then reattach them as described above.