You could probably take the pigtail off the light and by using a test light cycle thru you hi/lo beams to ensure you have power. If you don't have a test light pull both lights and hook up the left light to the right. That will tell you if you actually have a bad light or an electrical problem.
Check fuses and relay if you have one.
First, if the headlight is dimmed check the fuses first. And all that is holding the light in is a few screws
check the fuses for the head lights check the fuses for the head lights
Check the fuse compartment in the fuse box located in the engine compartment.
You need to check the wiring around headlights, fuses and the bulbs.
If both lowbeam headlights fail at once, it probably isn't the lamps themselves. That would be a fluke. The wiring is usually not at fault. It is vulnerable at the ends where the connectors are because they might become corroded. Check that last. That leaves the two other vulnerable points in the circuit: the fuse and the light switch. Check them out.
realign the head lights, check battery termninals
I had this problem on an '02 525i. The socket in the wiring plug was corroded. Replaced it and no problems since, over 1 year now.
check the ground wire to that headlight .
If the main headlight fuse keeps blowing out on a 2002 Kia Sportage, check for a short in the wiring. Also check to make sure there is no moisture in the headlight holder.
check your manual
To check the ECM on a 2001 Toyota Tundra, you will need the user manual.