2001 impala

headlights go out randomly i can use manual switch or high beam switch a few times and they come back on can you help me with this… very dangerous as i drive at night most of the time…