Sims' energy slowly decreases while they are awake. If a Sim runs out of energy, he/she will collapse from exhaustion and fall asleep on the floor.
Sims can replenish their energy by sleeping. Toddlers will awaken whenever their energy bar reaches 100%. If an older Sim's energy bar reaches 100% before midnight, the Sim will either awaken when it becomes full, or will awaken at midnight. Otherwise, children, teens, young adults, and adults will usually sleep until 6:00 am (06:00) unless they are awakened earlier, though they will automatically wake up when their energy bar is at 100% if they have other actions queued up by the player. In addition, if Sims with full energy bars have autonomous reactions pushed on them, they may wake up. Elders who are asleep past midnight will usually awaken shortly after their energy bar reaches 100%. In The Sims 3, the player can drag the action handle to specify a time for the Sim to wake up.
Sending a Sim to work or school with low energy will harm their performance. While they won't collapse from exhaustion away from home, they may do so as soon as they return. In The Sims 2: University, a Sim that gets very tired while eating will fall asleep face first in their food. Oddly enough, they will still eat it afterwards.
In The Sims Social, this need was renamed to Sleep, possibly to avoid confusion with energy in that game.
If a Sim needs a quick boost of energy, they can drink coffee or espresso. Children cannot do this, but with The Sims 2: Seasons, they can get some energy by drinking hot chocolate from the Perfect Packets Hot Chocolate Maker. Sims can get coffee from a coffeemaker or an espresso machine. Sims can buy an espresso from the espresso bar[Unleashed][TS2:U] while on community lots, but they may be better off going home instead, as coffee and espresso decreases bladder, and may have other side effects.[TS2]
Sims also gain a small amount of energy from sitting down.[TS] Sims can nap on lounge chairs, recliners, and sofas, but it doesn't replenish energy as effectively as sleeping in a bed, and active Sims may wake up before they're fully refreshed.[TS][TS2]. In The Sims 3 and The Sims 4, Sims will automatically wake up from a nap after a few hours, with a moodlet that counteracts the effects of low energy.
Sims will not die from exhaustion, though if they become extremely tired while in a pool, they can drown. They will normally get out of the pool autonomously before this happens unless they are prevented from doing so, such as by removing the pool ladder.
Equivalents for other life states
The Sims 2
For servos[TS2:OFB], the equivalent of energy is Power. Servos can replenish this by sleeping or napping, the same as Sims can. If it's daylight, they can use the "Recharge" self-interaction to go outside and stand in the sun until their power is replenished. If they are in gold or platinum aspiration, they can also restore their power by using The Eclectic and Enigmatic Energizer or drinking the Elixir of Life. If the power need gets too low, a servo will either go outside to recharge, or go berserk and require repairs by a Sim with high mechanical skill, preferably one with a gold talent badge in robotics.
For PlantSims[TS2:S], the need for sunlight has many aspects of the energy motive. If a PlantSim's sunlight need becomes too low during the day, the PlantSim will go outside to be in the sun. If the sunlight need becomes critically low at night, the PlantSim will go outside and collapse, and will revive after dawn the next day.
The Sims 3
Mummies[TS3:WA] do not have an energy motive at all, but move very slowly.
For plumbots[TS3:ITF], the equivalent of energy is Battery Power. A plumbot recharging station is available in Buy mode, and plumbots will recharge while shut down. Charging at a recharging station does not appear to be that pleasant however. The plumbot will repeatedly twitch and sometimes bend down and put its hand to the side of its head as if in pain while charging. If a plumbot's battery power is completely drained, it will shut down. A plumbot with the Solar Powered trait chip will gain battery power while outdoors in daylight. Unlike servos, plumbots can remain active while using solar power, but the chip may not always provide enough power to completely offset the power drain caused by whatever the bot is doing. Plumbots can syphon power from appliances, but at a cost to their maintenance need.
The Sims 4
For vampires[TS4:V], the equivalent of energy is Vampire Energy. Vampires recharge vampire energy by sleeping in a normal bed, sleeping in a coffin, or dark meditating. Vampire energy is also used for Vampire Powers.