When the heart is struggling, often times it will speed up. It does this as a way to try and fix things that are going wrong within the body. When a person has an increased heart rate they will often start to feel more anxious or stressed. Stress and the rate of the heart are directly related.
Many people who are about to have a heart attack report that they have felt anxious and stressed for no real reason right before it occurs. It is important to note that feelings of anxiety and an increase in heart rate are also associated with panic attacks. Panic attacks are often confused with a heart attack. The best thing you can do in this type of situation is to try to remain calm and focus on your breathing. It is also a good idea to seek medical attention in order to be on the safe side.