At first they used a different chemical called amyl nitrite, a compound that we now know has a nitrite group that dilates blood vessels and lowers blood pressure.
This increases the flow of blood and oxygen to the heart and keeps it from having to work so hard, But at the time no one knew why amyl nitrite worked only that it did.