A defibrillator is a device designed to deliver an electric shock to the heart, helping to restore a normal rhythm during sudden cardiac arrest.