When your
heart goes out (see
heart attack) sometimes it hasn't stopped completely but is fluttering weakly, with different areas of the heart beating independently of one another. That's
fibrillation.
Since that isn't doing you any good, somebody invented a device (a
defibrillator) to give you an
electric shock, which makes your heart give a good unified
pump. Sometimes this gets your heart going again. Then you're
defribullated.
Fibrillation does not always preceed or cause
heart attacks.
If you have an
irregular heartbeat you might also correct it by means of chemical treatments or with a
pacemaker.
In hospitals,
Code Blue is often used to indicate that
defibrillation is needed.