As the heart begins to struggle, it will often increase its speed as it tries to fix things. This increased heart rate will then lead to feelings of anxiety and stress, seeing as stress and our heart rates are very closely linked. Many people on the brink of heart attack report that they felt stressed and anxious for no reason first.
Note that this might also be the result of a panic attack, which is another condition that is often confused with a heart attack. Ironically, worrying that you are suffering from a heart attack is often what makes the panic attack much worse. The best solution is to control your breathing and stay calm, but to seek medical attention to be on the safe side.
Of course it is not out of the question either that a panic attack could cause a heart attack, though this is unlikely in a healthy, young patient.