Permanent magnets are manufactured by using a high-retentivity ferromagnetic material as the core of an electromagnet for an extended period of time. The coil of the electromagnet carries a large direct current, causing intense magnetic flux of constant polarity within the material. (Don’t try to do this at home. The high current can heat the coil and overload a battery or power supply, which produces a fire hazard and/or the risk of battery explosion.)
If you want to magnetize a screwdriver a little bit so that it will hold onto screws, just stroke the shaft of the screwdriver with the end of a bar magnet several dozen times. Once you have magnetized a tool in this way, however, it is nearly impossible to demagnetize it.