Manufacturing permanent magnets
Some materials are "SOFT" magnetically, meaning they do not tend to stay magnetised.
Some materials are "HARD" magnetically and they tend to stay magnetised.
Permanent magnets are made from "hard" ferromagnetic materials such as iron, nickel, cobalt and steel (which contains iron).
We can render a steel bar magnetic in the following way:
Lay a piece of iron on a table, put the north pole of a magnet in the middle and draw it over half the iron; then put the south pole on and draw it over the other half.
But this can be quite a soft magnet.
For more permanent magnets, scientists create all sorts of processes and alloys. Most methods involve putting a semi-molten alloy into a very powerful electromagnet and cooling the rod down slowly so the north and south poles set in a "hard" way.