The primary purpose of an air pump is to add air into your vehicle's exhaust stream so that the unburned gasoline in the system does not burn before it comes out of the tailpipe and contribute to smog in our atmosphere. This was a major problem for many older cars before emission controls and fuel injection systems were used to regulate engine functions more precisely.

A bad air pump can disrupt the finely tuned air-fuel ratios that control your vehicle's performance. This may lead to a rough run, engine hesitation, or a stall when you're accelerating.
In addition to this, a bad air pump can also disrupt the proper operation of the secondary air injection system that helps to regulate emissions. This can cause your check engine light to illuminate, or even throw a trouble code.
If you think you have an issue with your car's air pump, it's best to take it to a mechanic who has the skills and diagnostic equipment needed to properly repair this system. They can thoroughly inspect your air pump, and any related belts and hoses that are connected to it, to find the source of the problem and make the necessary repairs.