Headlights are light bulbs not too much different from the bulbs in your home...they must be periodically changed. In short...you have a blown bulb. If you replace the bulb and the lights still do not work you must check the fuse to see if it is blown. If it is not the bulb or the fuse, you have an electrical problem requiring a mechanic.
check the fuses
I would first check all fuses. My 2002 uses a weird configuration and requires several fuses to work all of the lights properly.
Check the fuse for the headlights. It is probably open.
Check the fuse.
my headlights work but my taillights and dash light dont work whats wrong
The headlights could have bad bulbs or a bad fuse; the two sets of lights are on different circuits.
check the fuses - there is no fuse for the headlights.
Check your ground wire, all the lights must be grounded back to the vehicle.
The headlights work on a totally different relay than the parking and fog lights. The headlight relay or headlight fuse is usually blown when only the parking and fog lights work.
Fuse, wiring, bulbs
If your headlights work, but your tail lights don't, your bulbs could be blown. It is possible that you have a shortage in your car.
If the headlights on the 2004 GMC Envoy are not working, there could be a loose connection somewhere. If all of the other lights are working, it is most likely not a fuse that has blown. Double check the wiring to see if there is a loose connection.