The F-16 has an "emergency blow-down" reservoir containing approximately 3,000 psi gaseous nitrogen. Hitting a switch will release this pressurized nitrogen into the hydraulic system dealing with the landing gear. Ergo, hitting that switch will extend the gear, even with the engine off.
So yeah, the landing gear will still work in the event of a complete power failure. It has backup systems.
In the older A-4 Skyhawk, the landing gear retracted up and forward. So, in the event of a hydraulic failure, if you could get the gear doors open, the airflow past the aircraft in flight would "drag" the gear down and aft and lock it into position. I think that's a pretty slick design.