Even though this is an issue focused on emergencies, one thing should be clear: An electrical failure on a daytime VFR flight does not make an emergency. Nuisance should be a better way to describe it. A total electrical failure at night or in the clouds is a much more significant event. Even so, recognizing the symptoms of a failure and how to treat it is important regardless of when, what, and where you may be flying.
Most light aircraft have a basic electrical system consisting of a battery, alternator or generator, a voltage regulator, and at least one electrical bus that connects available power to those items that need it. The magnetos are their own self-contained system, a benefit of which is that if the electrical system goes to bed. The engine will keep running.