A transistor is a semiconductor device that can be used as a switch or amplifier. It has three leads called the base, collector, and emitter. There are two main types, NPN and PNP, which differ in their layer structure and polarity. Transistors are commonly tested using a multimeter to check the conduction between lead pairs or in a simple circuit with a battery, resistor, and LED to verify it can amplify current and switch the LED on and off.