The Mass Air Flow sensor (MAF) can cause the engine to run poorly or stall. You should try cleaning it with MAF sensor cleaner. Then if the problem persists you might need to replace the MAF sensor. It is sometimes possible to troubleshoot a faulty MAF sensor by unplugging it. If the engine starts and continues to run after unplugging the MAC sensor and it wouldn't before you unplugged the sensor. The MAF sensor could be bad.
To clean it the MAF sensor: Remove it by unscrewing the two screws that hold it in place (see photo-1). Then spray the small coiled wires with the MAF cleaner. Don't touch the wires. Be sure the o-ring is properly in place when you reinstall.
Other types of cleaners may damage the MAF sensor. Only use cleaners approved for cleaning the MAF sensor.