The most important thing is to understand why someone is having trouble breathing. It could be because they are simply out of breath or there isn’t enough oxygen is a specific situation like when climbing a mountain or in a small room with many people.
However it could be that the person has an illness that needs medical attention. This you may not be able to diagnose as an individual and you would need a medical professional to help.
Therefore as I stated in the beginning, it is most important to know the cause then you can help the person.