Both heart failure (formerly known as congestive heart failure) and chronic obstructive pulmonary disorder (COPD)can cause shortness of breath and chronic cough, so it can be hard to tell the difference based only on those symptoms. However, the fluid retention associated with heart failure causes additional symptoms, such as pressure and heaviness in the chest and swelling in the abdomen, legs, and feet. COPD symptoms, at least early on, are more likely to be clearly breathing related.
Keep in mind that both conditions can cause chronic cough, particularly a "wet" cough that brings up sputum. However, if the cough is dry, heart failure is more likely to be the cause.
It's common for people to have both COPD and heart failure, particularly if they're smokers or former smokers. In this case, the two conditions are considered comorbid and may interact and overlap. Also, COPD can lead to heart failure because the heart has to work harder to get oxygen distributed throughout the body when the lungs don't function normally. Over time, the overworked heart becomes damaged.
It's difficult to tell the difference between the two conditions without medical tests, so you'll need to rely on a doctor to determine whether it's heart failure or COPD or both.