The foxglove plant, like many other plants, is a source of beneficial chemicals, and is used in a group of medicines called digitalin: a white crystalline glycoside, C36H56O14, that is obtained from the seeds of the common foxglove. Crystalline glycoside has be used for the treatment of heart conditions since at least the late 1700s.
Digitalis is prescribed for patients in atrial fibrillation, especially if they have been diagnosed with congestive heart failure. Digoxin was approved for heart failure in 1998. It is used to increase cardiac contractility (it is a positive inotrope) and as an antiarrhythmic agent to control the heart rate, particularly in the irregular (and often fast) atrial fibrillation.