Battery dies only when I try to start the car

Internal corrosion of the main wire to the starter can cause this kind of trouble. If you have a jumper cable you can use it to bypass the wire to see if that clears the trouble. If the starter works ok doing that then install a new cable. Internal wire corrosion is a fairly common problem.