You curse yourself (under your breath) for not changing the batteries, but wait, the batteries ARE good. There is no leakage in the battery compartment or on the batteries. The flash powers on when the batteries are inserted. You hear it cycling up with that high-pitched sound that drives dogs crazy. The display (if your flash has one) is working, showing all those numbers you really do not understand but like to see because it makes you feel like you are using a pro flash. The LED's are lit. So what is the problem?
Have you cleaned the flash hot-shoe? Don't say yes because we know you have not. Your camera's hot-shoe mount is exposed to everything from dirt, dust, moisture, that cup of soda you spilled, those sneezes and coughs from your nephew (who always seems to be sick), the oil from those fries you ate, etc. etc.
All that junk can leave a residue on the mount contacts that will make it hard, if not impossible for your camera to recognize the attached flash. Here is what you can do. Get an old but clean toothbrush (no, don't use your wife's or husband's). Get some rubbing alcohol. Dip the toothbrush into the rubbing alcohol (or cup with some rubbing alcohol), shake the excess off the brush, and then clean both the hot-shoe mount on your camera AND the flash hot-shoe. Why, clean the flash's mount? You just soiled it with all that junk on your camera so both mounts will now need a cleaning. Next, either let the cleaned components air-dry or use a squeeze blower to blow off the excess liquid.
Now, try the flash on your camera. If it works, you have solved the problem. If not, either your camera, or flash is the problem.