If your headlights still don't come on after you've completed all of the more obvious checks -- the fuse, battery, loose connections to the headlamps, burnt-out headlamp bulbs -- perhaps your relay is bad. You don't need to go to a mechanic to check it. The location of the relay will vary depending on car make and model year. Look on the fuse panel or in your owner's manual. A few simple checks will tell you if it's good or bad.
Push the relay firmly into its socket. Most headlight relays plug into a standard relay socket. If it works loose, one of the connections may not be making contact. If it seemed loose, try turning on your headlights again.
Look at your lights. If only one headlamp comes on, your relay is OK. You either have a bad headlamp or bad wiring.
Listen for the relay to click. Have a friend turn the lights on and off as you look under the hood of your car. If you don't hear the relay clicking, it's probably bad. You can also touch it to feel the action of the click.
Replace the relay. Get a new one from an auto-parts store, but make sure to check if you can return it. Then make sure to keep the receipt and don't destroy the box it came in. If the new relay fixes the problem, the old one was bad.
Bypass the relay. With the relay out of the socket, run a small piece of 14 to 20 gauge wire stripped at both ends to short the "common" (C) pin of the socket to the "normally open" (NO) pin. Be sure your lights and ignition are turned on. If the lights now come on, your relay is bad. On a standard five-pin relay socket, the C pin is labelled 30 and the NO pin 87.