One of the symptoms of congestive heart failure is swelling of the extremities, which we know as edema. In the 18th century, this swelling symptom was called dropsy (but no one knew what caused it).
An English doctor, William Withering, published a paper in 1785 describing how the ground-up leaves of the foxglove plant seemed to resolve swelling in many patients. It would be another century before the connection was made between heart failure and edema.
Digitalis, which is derived from the foxglove plant, lowers heart rate and strengthens the heart's contractions. It's also used to treat people with abnormal heart rhythms. Digitalis is a serious drug, though -- levels of it in the body have to be monitored closely, because too much can lead to severe side effects, including death. Even if symptoms pass, patients are often kept on digitalis medications indefinitely, so know that when you start.