Difficulty breathing can be associated with heart problems, yes, as in congestive cardiac failure, or atrial fibrillation, where the breathing problems are due to a backlog of fluid in the lungs.
A heart attack does not usually cause breathing difficulty except as a consequence of the associated chest pain, however "shortness of breath" is often reported as a symptom as the body is trying to compensate for the lack of oxygen to the heart. There is no actual impairment of breathing.