Check the big pipe from the air filter and all other air/vacuum pipes for splits, leaks or loose fitting.
If they are ok fit a new air flow meter. Often it has not totally failed, so has not put the warning light on, but is giving false information to the ECU. Try to borrow one from a car of the same model which is running well before buying, it's easy to swap.
If it's failing the car will often run better with it unplugged, as it will go to default settings.
In future give make/model/year etc, better questions tend to get better answers.
vlad the inhaler
August 2009