It appears that sodium metal can be obtained from the anhydrous reaction of sodium hydroxide and magnesium. The popular video of this synthesis on youtube is pretty irresponsible, though. The video in question shows the combination of powdered sodium hydroxide and magnesium, which leads to an explosive reaction after ignition with a fuse. If too much material is used, this could be very dangerous. Powdered solids react very quickly due to their high surface area, and should be avoided.
The reaction is likely:
2Mg(s) + 2NaOH(s) -> 2MgO + H2(g) +2Na
While metallic sodium cannot be electrolytically produced in aqueous conditions, it can in the absence of water. I have not been able to find standard reduction potentials for sodium or MgO in anhydrous conditions, but the demo video I mention above seems to show that sodium has been produced, indicating the redox potential must be positive. If you use standard reduction potentials tabulated for aqueous conditions, a negative redox potential is obtained, but it is not directly relevant to the anhydrous reaction above.
The sodium metal produced is really not that dangerous compared to burning magnesium. Burning magnesium is the much bigger hazzard here, since it burns at very high temperature (hot enough to weld steel), can't be extinguished with water, and produces a bright enough flare to cause blindness. You should never look directly at burning magnesium.
The sodium slag produced in the video should not be recovered in mineral oil over water due to the combustion hazard. Instead, the metal and slag can be separated in a pyrex beaker by heating to around 100 degrees C when mixed with mineral oil.Note that a hotplate should be used, not an open flame. Mineral oil can burn. The sodium is very low melting, and will pool at the bottom of the mineral oil, with the magnesium and sodium oxides rising to the top of the metal pool. The metal oxides might even float to the top of the mineral oil where they can be skimmed off. This is a relatively safe procedure since the molten sodium is protected from moisture by the mineral oil. This is a common technique for collecting sodium into one large plug from the small oxide encrusted pieces that tend to accumulate in a sodium reagent bottle after lots of use. I employed this technique quite a bit in grad school.
Mercury should not be used at all. Mercury is a potent and persistent neurotoxin that is hard to clean up. If you ever do use mercury, make sure that you have elemental sulfur on hand to scavenge any spills. Mercury is not easily separated from sodium. The two metals make an amalgam, which is a mercury alloy.
Last, there's really no reason to do this reaction. It's very dirty, as you can see in the video. If you reaclly want some sodium, you can buy it on amazon (http://tinyurl.com/ow5cyww), although it is very expensive.
Keep in mind, though, that hobby chemistry is a pretty dangerous pastime. This kind of activity needs to be conducted with proper safety equipment. At the very least, it should be done outside, away from flammable materials, using impact resistant polycarbonate safety glasses and with a working CO2 or chemical retardant fire extinguisher at the ready. A proper chemistry lab has chemical resistant work surfaces, extinguishers, fire sprinklers, fume hoods, emergency respirators, safety glasses, blast shields, lab coats, heavy gloves, etc. Even with all of that safety infrastructure, a chemistry lab can still be a very dangerous place.
In my grad school research group, a grad student working in the 1970's had been blinded by shrapnel produced by the explosion of a perchlorate salt. The student in question had been wearing safety goggles. The glass shrapnel penetrated the glasses and took out both eyes. As a result, my research advisor had banned use of perchlorate salts. Many near misses occurred when I was in school. I remember a student had heated a flask of ether that he held in his hand with a heat gun (produced a blast of air hot enough to melt lead). This was a very dumb thing to do since the autoignition temperature of ethyl ether is only 190 degrees C, and this was a grad student at UC Berkeley, one of the top ten chemistry grad schools in the world. Even brilliant chemists can do very stupid things. The super heated ether ignited, the student panicked, dropping the flask. The flask shattered and the ether spread to cover the floor of the entire lab with fire. Luckily the ether was quickly consumed, but not before the sprinklers went off. I once dropped a bottle of highly reactive phosphorous compound that filled the lab with toxic green smoke. We had to evacuate, and when I got to the hallway, I realized that the phosphorous compound had melted almost completely through my heavy leather work boots. I had to throw the smoking boot back in the lab. If we didn't have proper ventilation, we might not have survived. I was once sitting outside taking a break from lab work, and watching birds fly over Latimer Hall. It was at that time, a burst of opaque, brilliant yellow smoke issued forth from one of the exhaust stacks. The smoke had been pulled into a fume hood somewhere in the building, and had been too much for the air scrubbers to absorb before being exhausted out of the roof. A seagull flew through the cloud of yellow smoke, and tumbled down to the ground. I ran over to the bird to find it was dead and had an overwhelming odor of geraniums and sulfur. I have no idea what the chemicals involved were, but I was coughing and nauseous the rest of the day.
Without all of the safety equipment and industrial hygiene experts at Cal, the death toll to the chemistry grad students would be pretty high. Don't do this stuff without the safety gear and training. Blowing stuff up is not worth the extreme risk to life and limb. If you really want to blow stuff up or play with fire, learn how to do it right. Many metropolitan areas will have organizations that will teach fire arts. For instance, in the San Francisco bay area, there's "The Crucible".