All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
Martyrdom is of various degrees, the highest of which is dying in the battlefield in the cause of Allaah. Indeed, we have already clarified the various types of martyrdom and its rulings in Fataawa 88945, 89756 and 89399.
However, we have not come across dying due to a heart attack in the texts mentioned about the types of martyrdom, and most likely, this is among the sudden death. In fact, the Prophet said about the sudden death: “The sudden death is a rest for a believer and a regret for the dissolute person.” [Ahmad]
Moreover, the Prophet used to seek refuge in Allaah from the sudden death. Therefore, a person should always renew his repentance to Allaah and always be prepared to face death and be careful from dying while committing a sin.
For more benefit, please refer to Fatwa 91542.
Allaah Knows best.