A magnet has all the magnetic poles of its composite molecules aligned. A strong magnetic field magnetises steel and other ferrous (iron-based) metals. For instance, stroking a pin along the axis of a magnet in the same direction repeatedly will align all the polarities within the needle. This will temporarily turn the pin into a magnet. To demagnetise a piece of steel or other ferrous material, you must scramble the polar alignment within the piece of metal to return it to a random state.
Check the strength of the magnetic field your piece of steel has. Put it on a flat surface and place an iron nail near it. Pull the nail away until the magnetised piece of steel no longer attracts it. Measure the distance so you can judge your progress at demagnetising the steel.
Align the steel piece in an east-west compass orientation. Drop the steel piece on the cement floor repeatedly. The shock will knock the magnetic dipoles out of alignment and eliminate the steel's magnetic properties.
Check the level of magnetism by remeasuring the pull of the steel on the iron nail.
Hold the piece of steel in an east-west compass orientation. Hit the steel piece with a hammer repeatedly, 50 to 100 times. It's not necessary to deform or dent the piece.
Recheck the magnetic strength of the piece of steel. Repeat Steps 1 or 3 until the steel is demagnetised.
You can use a degaussing unit to demagnetise metal, if you have one, but randomising polarity through impact works well for most steel items, such as screwdrivers.
While heating materials past their Curie temperature will also demagnetise them, the Curie temperature of low-carbon steel is high, around 754 degrees Celsius. Heating to this point may affect the brittleness of the piece.