Magnets have a north and south pole, and bringing two like poles together repels magnets while unlike poles attract each other. The distance in which two magnets begin to repel or attract each other is determined by the strength of the magnetic field.
Magnets come in two basic types: permanent and temporary. Permanent magnets hold magnetic properties for long periods of time, while temporary magnets hold magnetic properties only through an electric current or a magnetic field produced by a permanent magnet. Magnets such as lodestone can be naturally occurring, while some magnets are man-made using synthetic materials, which are typically iron alloys.