temp gauge: if you changed the sensor and checked the gauge, the only thing else is the wiring between the two. find where the connection is open and fix it.
headlight: have you verified that there's voltage to that headlight socket when you turn your headlights on? check that, and find out where the connection is open and fix it.
2001 Ranger XLT 4.0L SOHC
Silver Frost w/ Dark Graphite interior
Summit 3" Body Lift
31x10.50 A/T tires
Explorer overhead console
Explorer auto-dim mirror
Aux1 & Aux2 inputs on factory AM/FM/CD/Cassette
Door-dinger silencer button
Seamless retractable roof and passenger-side ejection seat with steering wheel mounted controls and safety interlock