This is how I was taught back in the 1970's also. FBinNY is correct:
You'll hammer the crank out in a single blow, but the key is you have to support the arm on a rigid equivalent of an anvil. If you have a heavy vise on a solid bench that'll work, but my preferred method is to stand a 1" water pipe on a concrete floor or directly over a brace on a wood floor, or someplace equally solid.
The 1" galvanized steel pipe is where the cotter pin drops in to after you hit it with a BRASS dead-blow hammer. Yes, the pin straddles inside the pipe. The pipe should be high enough that the bike can stand almost by itself with it positioned under the crank arm. This facilitates it being a one-man job. The brass hammer helps to reduce damage to the cotter pin for potential re-use. And FB is right, one big "determined" but
NOT cataclysmic or mis-aligned blow. If you miss and hit the bottom bracket shell, can you say woopsiedaisy!!!! It is easy to miss BTW.
The old carpenter's adage applies here slightly re-worded:
Aim TWICE and hit once.
And FB is correct that this works because the energy of the hammer hitting the cotter pin and crank is not absorbed. If it's not supported by the pipe the frame flexing absorbs the blow and multiple blows are required and that can ruin the crank.