Energy

Sims' energy slowly decreases when awake. If a Sim runs out of Energy, he/she will collapse from exhaustion, and fall asleep on the floor. 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 can do so as soon as they return – and then they'll just be an unconscious Sim littering the pavement. If their energy drops too low while eating, they will fall asleep on their plate.

Sims can replenish their energy by sleeping. Sims will automatically sleep until 6 am or until the Energy bar is back at 100%. In The Sims 3, the player can drag the action handle to specify a time for the Sim to wake up.

If a Sim needs a quick boost of energy, they can drink coffee or espresso (although children can't do that). Sim can buy an espresso from the espresso bar while at community lots, but really, the best thing to do is simply have your Sims go home when they get too exhausted, as coffee and espresso decreases bladder, and may have other side effects.

Sims also gain energy from sitting down. Sims can also take naps on lounge chairs, recliners, and sofas, but napping doesn't replenish energy as well as sleeping in a bed, and active Sims may wake up before they're fully refreshed.

Sims will not die from energy depletion alone, but will drown if they run out of energy while in a pool.

Pets
Pets lose energy quite quickly if they are running around, and so need to sleep about twice a day. It is therefore essential that you provide them with some baskets or doghouses for them to sleep in.