A transistor takes in a small electrical current at its base pin and amplifies it such that a much larger current can pass between its collector and emitter pins. The amount of current that passes between these two pins is proportional to the voltage being applied at the base pin.
There are two basic types of transistors, which are NPN and PNP. These transistors have opposite polarity between collector and emitter. For a very comprehensive intro to transistors check out this page
NPN transistors allow electricity to pass from the collector pin to the emitter pin. They are represented in a schematic with a line for a base, a diagonal line connecting to the base, and a diagonal arrow pointing away from the base.
PNP transistors allow electricity to pass from the emitter pin to the collector pin. They are represented in a schematic with a line for a base, a diagonal line connecting to the base, and a diagonal arrow pointing towards the base.
Transistors have their part number printed on them and you can look up their datasheets online to learn about their pin layouts and their specific properties. Be sure to take note of the transistor's voltage and current rating as well.