I just did an install on my 2002 GMC Sonoma. I basically went to a GMC site and ,although I did not find information specific to my model of truck, I did find some wiring information and was able to make an informed guess as to which wire was which.
Here is a link to what my GM stoplight switch wiring looks like. There are two thicker wires and other thinner wires. The "cold" wire for mine is the thicker white wire. To test this wire I scraped off a bit of insulation and then probed the bare wire with a 12V test light
. When I pressed on the brake pedal the light
came on, indicating power. When I took pressure off the brake pedal the light
went out. I had found the proper wire.