My wife is pregnant and has asthma. What can she do to prevent her from getting asthma attacks?

Treat and avoid. If she has allergies, avoiding allergens (things she is allergic to) is essential; if she has symptoms of post nasal drip - a nasal rinse and a nasal steroid are safe. If she continues to have symptoms, an inhaled steroid is also safe. Controlling reflux helps (reflux aggravates the airway)... Work with your OB and pulmonologist.
Asthma control... ...In a pregnant woman is more challenging, but is also more important for a good outcome. Your doctor will probably concentrate on inhaled medications, as they are less likely to enter the bloodstream in sufficient quantities to affect the fetus.