Your battery was dead.
In many cars, when the battery can't provide enough cranking amps, you will hear a clicking instead of the normal starting sound.
The starter battery draws a lot of current. When that happens, the voltage available to the rest of the system drops dramatically, especially if the battery is weak. That's why your clock reset itself.
Hook up a smart charger. A cheap one is a Battery Tender Jr. Avoid a dumb charger, which will gladly push 13.8V at 2A in to your battery until all the electrolyte has boiled away. A good charger will have bulk, absorption, and float stages. A really good one will have a desulfate stage, which can help revive an older battery.
You need to figure out whether the problem is in your charging system or in the battery. A mechanic or a battery shop will have a testing tool that will measure the CCA of your battery. To get the best possible test, charge the battery to full, then let it rest disconnected for 24 hours. If the number is very low, your battery can't do the job. Letting a desulfating charger work for a long time may make a difference, but if this is your daily driver and you don't have a spare battery, you probably should just replace it.
If you decide to replace your battery, check out How do I apply dielectric grease to my battery?
If the battery checks out, then the problem is in your charging system. Perhaps there's a loose connection, or perhaps your alternator is bad. See your service manual for instructions on troubleshooting the charging system. You'll definitely want a good multimeter at this point, with 3 1/2 digits of precision.
Remember that batteries have lead, produce hydrogen, and can get acid on things. Nitrile gloves, goggles or face mask, clothes you want holes in, and wash up well afterward.