Magnets come from an ore, magnetite, which can be found in different types of Earth's rocks. The rocks are called igneous, hydrothermal veins and metamorphic.
Magnetite, a black mineral, contains both ferric and ferrous ions, making it a good source of iron. Examples of igneous rocks that contain magnetite are amphiboles and biotite. Limestone is an example of metamorphic rock that contains magnetite. Hydrothermal veins like galena and pyrrhotite contain magnetite too. In the U.S, Wisconsin's Gogebic Range and Black River Falls are rich in magnetite.
Magnets can also be man-made. They are made of alloys or metals like iron. Though there has not been any concrete proof, yet magnets are advertised as pain management products.