Terraria's game mechanics include things bought and found. You can buy Wire from the Mechanic (an NPC found in the Dungeon) to start off. To place wire, you need a Wrench (also bought from the Mechanic). Connecting things using Wire will cause doors to open, torches and light sources to go out, traps activating, and Active Stone Blocks to become Inactive Stone Blocks and vice versa. Many players use these mechanics to defend their homes.
Wirecutters: mines wire
Wrench: places wire (Note; there are 3 different color wrenches to place different colored wire. Red, green, and blue)