Hi,
There is a difference between heart attack and heart failure.
Heart attack arises from a possibility of a blockage in the coronary arteries, which are the arteries supplying the heart.
On the other hand, heart failure is the inability of the heart in pumping sufficient blood to the rest of the body.
Both of these can lead to cardiac arrest, which in layman terms, is when a person drops dead, but these 2 conditions are different.
I hope this is of help :)