The engine does not turn on, problems with the battery

What could be the cause of the car running out of battery at such an inopportune time? The most common is to have left the radio on, the lights of the car or any other device that depends on the battery. Anyway, to restart your car when it has run out of battery, you...