A ventolin or salbutomol inhaler - the blue one - works by opening the passages so that you can breathe more easily.
Many breathing difficulties can be treated in this way, not just asthma.
It is also possible to develop asthma-like symptoms when you have a cold, chesty cough, have been exposed to an irritant like dust or pollen, when you have exerted yourself or occasionally when you are under stress. I developed asthma during my fifth pregnancy, it occasionally resurfaces when I'm run down, I am not an asthmatic but I do use a blue inhaler when I feel the need. If I've run out and don't want to wait a month to see the doctor for a prescription I use my husband's.
It is a relatively safe thing to do, but I wouldn't do it just for kicks, and if your symptoms persist and you are using a non-prescribed inhaler regularly, then you need to see a doctor as you could be masking symptoms of a more serious condition.