Iron has long been associated with magic and the Wikipedia article "Iron in folklore" is worth a read.
"Cold iron" is historically believed to repel, contain, or harm ghosts, fairies, witches, and other malevolent supernatural creatures. This belief continued into later superstitions in a number of forms:
Nailing an iron horseshoe to a door was said to repel evil spirits or, later, to bring good luck.
Surrounding a cemetery with an iron fence was thought to contain the souls of the dead.
Burying an iron knife under the entrance to one's home was alleged to keep witches from entering.
placing a knife under a bed to "cut" pain.
"Cold Iron" is a substitute name used for various animals and incidences considered unlucky by Irish fishermen. A similar phenomenon has been found with Scottish Fishermen.
The folklore site "Folklore Thursday" is equally interesting:
Some fairy tales are older than any of the languages used to tell them… and the oldest ‘folk-tale’ of all seems to be that of a blacksmith forging a deal with the devil.
These findings were made known during 2016 in an article published in the Royal Society Open Science Journal,[...] The basic story is that of a blacksmith who outwits the devil, causing him to be fixed to a spot and only given leave when he had shared the dark magical arts of smelting and metalworking with the smith.
The association between iron and magic is widespread, and stems from long before the Iron Age. One of the oldest iron artefacts is a dagger found in the tomb of Tutankhamun, having been made circa 3,200 BCE, which is about 2,000 years before the Iron Age. [...] The metal in Tutankhamun’s dagger was worked from iron that had been ‘a gift from the gods’, ‘the solidified tears of the sun’ that had fallen to earth in the form of what we now call meteorites.
Edit to add. From the OED:
Cold adj. 2b. of material substances which in their natural state communicate this sensation by contact. Often as a descriptive epithet of iron or steel, as the material of a weapon.
c950 Lindisf. Gosp. John xviii. 18 Stodon..æt gloedum forðon cald wæs and wearmdon hia.
a1616 W. Shakespeare All's Well that ends Well (1623) i. i. 103 When Vertues steely bones Lookes bleake i'th cold wind.
1771 T. Smollett Humphry Clinker II. 204 To hazard a thrust of cold iron with his antagonist.
1816 W. Scott Old Mortality iii, in Tales of my Landlord 1st Ser. III. 69 Try him with the cold steel.