Head Lights Turn off after 10min

So I went to O'reilly's on my lunch break. The switch cost me only $15.99 with a lifetime guarantee. So I went to switch out the switch and it was fried and all melted down. So I hope this will fix the problem. I also want to thank everyone for all there helpful advice.