While power outages don't happen every day in most cities in Peru, they do happen frequently especially during the rainy season when storms can cause damages to lines and other infrastructure. Mostly, you deal with an outage like you would at home. Get out the flashlight and wait for the power to come back on. Normally this can take a while. So if the power goes out at night, don't expect electricity to be back until the morning.
More common and of much more annoyance are water shortages in Cusco. The city has a general problem and many places simply don't have water for a portion of the day, and periodically the tap will just dry up unexpectedly in your barrio at any time of the day. Families often save a big barrel in advance if they know that in the afternoon at a certain time the tap always stops running, or they rely on collections of rainwater from their eves. Have a few bottles on the counter can be a life saver if you suddenly find yourself without water for washing, cooking and drinking. Some buildings just automatically turn off their water at a certain point in the afternoon to save the resource and money.