A car clicking when turning the key could be caused by either a dead battery, loose battery cable connections, dirty or corrosive battery cable connections, and even a bad starter or starter solenoid.
Try cleaning the battery post and battery post terminals or check to see if the side post battery terminal connections are clean and not loose.
After you check all those connections then try charging the battery back up with a battery charger or jump start the car.
If it starts then the problem was a dead battery and you should replace the battery with a new one.
A bad alternator could also cause your battery to drain, especially overnight so it wouldn't hurt to take your car to a mechanic and get the alternator tested to be sure your alternator isn't draining your battery and if it is then you need a new alternator or you'll risk having another dead battery.