The headlight switch used on the GMC Sonoma is known to fail through normal operation. Since the headlight switch is also integrated into the interior lights, a malfunctioning switch can cause issues with interior lights as well.
This issue is well known with General Motors Trucks and SUVs, and is solved by testing and, if needed, replacing the headlight/dimmer switch. Bad grounding wires at the tail-lights, and dirty/corroded tow package wires can also lead to some of these issues.