The engine control module on GMC vehicles stores a variety of error codes and engine management settings. When this stored content causes problems, a reset of the ECM is in order. Momentarily cutting the system off from its power source is all that's required to force a reset. All codes will be erased, and the ECM will start from a clean slate.
Loosen the bolt on the black battery cable until the connector opens enough to come off the battery stud. Place a piece of cardboard between the cable and the stud to ensure no electrical connection remains.
Turn the headlights on for several seconds to use up any stored power, then return them to the "off" position.
Remove the cardboard and reconnect the battery cable by reversing the previous steps. The ECM has been reset to a clean state.