So if you see these kinds of rocks, then Magnetite might be nearby. Magnetite is rather rare, but if you find one block, then dig around it and you'll usually find more Magnetite blocks connected to each other.
You will need at least a Stone Mining Cell or better to mine/pull Magnetite blocks. Stone Mining Cells cannot only be crafted but also alternatively obtained from randomly spawning Obsidian Treasure Chests in darkness on blocks of the Stalactite layer.
Additional to that, Magnetite can also be occasionally received from Warmworms, Night Rocksters and from Rockzilla - either as a loot if you kill or dismiss them, or as their pet-harvest from time to time.
Obtaining Magnetite is one of the requirements to unlock the crafting recipes of Obsidian Mining Cells, Teleporters, and many electrical devices starting with the Wiring Tool itself, followed by the Switch, the LED, the Pressure Plate, Sensor, Delay Gate, Flip-Flop Gate, Mob Spawner, Loot Spawner, Inverter Gate, Logic Gate, Number Comparison Gate, Number Pad and Block Phaser.