What can you do if you have an asthma attack?

Depends. If you are a known asthmatic you should have an asthma action plan from your caregiver that outlines how you should approach an asthma attack. Typically it includes the use of a short acting beta agonist like albuterol and systemic steroids if severe enough.
Rescue inhaler... You should use your rescue inhaler as prescribed by your doctor. If you get no relief, you should go to the er right away, call 911 if necessary. Asthma attacks can be life-threatening so don't waste any time getting to the er.