It may have backfired and blown a vacuum hose off, this will alow too much air in the engine and make it not idle. If you look over the hoses you may see one off. If that is not it then you need to get it towed to a service facility because you may have a more serious issue like a timing belt failure that could cause more damage if driven.
ASE Certified Technician
20 years auto repair experience, ASE Master Tech, Mechanical Failure consultant, Expert Witness