Have the throttle body cleaned. That will fix it. You can buy a can of Throttle Body Cleaner at the parts shop, but I would recommend getting a mechanic to do it. It's a simple job.
RepairPal Certified shops can diagnose and repair your 2002 GMC Yukon XL 1500. They provide transparent pricing with a minimum 12-month or 12,000-mile warranty on repairs and services.