Sometimes I have a coughing asthma attack. What should I do?

See your MD. Cough is a very common symptom of asthma. This can be brought on by a cold, allergies, exercise. You should use your rescue inhaler (albuterol) and if frequent, see your md to see if you need more or better treatment to get better asthma control.
Asthma plan. Having a plan for attacks prepared with your allergist or pulmonologist is useful. Keeping albuterol (or other rescue inhaler) on your person helps. If you have a great many of these attacks, starting an inhaled steroid and trying to reduce allergen exposure helps.
Treatment... Coughing can be a sign of bronchospasm and airway inflammation. Treatments include bronchodilator and steroid inhalers as well as avoiding known triggers. See your doctor for evaluation and treatment, especially if your symptoms are worsening.