How to Magnetize Metal?

Whenever a fixed or electromagnet is kept near a ferromagnetic material or metal, it gets magnetized. This magnetization is temporary until magnet is removed.