2004 Chevrolet Malibu low beam light goes out

My passenger front low beam light keeps going out. I had the connector changed but my light bulb still goes out so I decided to hit the hood and it popped on. I’m wondering what will fix that

could be the bulb itself, with a loose filament. Try swapping with the other one and see if the symptom switches sides.

If not, try wiggling the wires to the bulb and see if that changes anything. If you can see the wire harness it joins, try wiggling that harness.

Sounds like a loose ground wire.

If the above ideas don’t solve it, you need to determine if battery voltage is getting to the bulb or not. Check at the harness connector to the bulb fixture, then at the bulb itself. Also verify that there’s no voltage present between the bulb socket housing and chassis ground. If you got good voltage at the bulb, it either has to light, or the bulb is faulty.