Headlamp bulb issue

Hey everyone, i had an weird bulb out warning on the way home from work while the headlight switch was in auto mode. Got home to check so i pulled up and turned the beams to manual and the drivers side was out then it popped on after a few seconds… I repeated it a few times and now they seem to work fine? Ballast issue maybe? Connection? Everything seems to be plugged in from what i can see… it was raining during my interstate drive home.