An electromagnet is the device used to magnetise magnetic materials. To magnetise a soft iron cylinder, it is placed within a solenoid (a coil of wire) through which an electric current flows.
Referring to the diagram: The soft iron cylinder is positioned inside a solenoid. When current is passed through the solenoid, it generates a magnetic field that subsequently magnetises the soft iron cylinder.
The arrows in the diagram denote the direction of the magnetic field within the solenoid.