A rectangular iron bar cannot be converted into a magnet.
We can make a magnet by rubbing a magnet on the surface of the iron metal. Due to the rubbing of the magnet, the particles in iron will be aligned in one direction. After the re-alignment of iron particles, the piece of iron metal behaves like a magnet.