This red, horseshoe-shaped magnet is found in Hollow Hill treasure chests. Point the ore magnet at the ground, charge it up, and release. If you are lucky, the ore magnet will bring anything from an ore block to a whole vein right up to the surface for you. Each ore magnet will bring 24 blocks, and perhaps a few more to the surface.
The ore magnet does not work on coal, but will otherwise work on any ore. It will even attempt to find ore blocks added by other mods, as long as they have "Ore" in their name. It attempts to find blocks by searching through solid rock in the direction the player is facing, with a range of 32 blocks.