Grip the handle of the cordless drill with one hand. Squeeze the buttons on each side of the battery with the fingers of your other hand.
Extract the battery from the drill by pulling it out of the drill handle with your hand. Or push the buttons on the side or back of the battery, then slide the battery out of the slots on the bottom of the handle to remove it.
Obtain a replacement battery of the same voltage, amps and size as the old battery. Find a replacement online, or take the old battery with you to a home improvement or hardware store to obtain the right replacement.
Hold the drill by the handle and slide the replacement battery stem into the bottom of the handle. Make sure that you hear the battery snap securely into position. Or slide the battery into place on the bottom of the drill handle.