Transistors aren't as magical as they seem. Think of them as a relay with no moving parts. They act like a switch to turn stuff on, but can also be used as an amplifier as well, which makes them extremely versatile.
On most Bipolar Junction Transistors (BJTs), both NPN & PNP transistors (ex. a 2n3904 & 2n3906), you have a Base, and Emitter and a Collector pin.
download.png
Look at that diagram of an NPN transistor and think of the Base as a knob on a faucet. Imagine the collector flows down thru to the emitter like a water thru a pipe. The amount of current applied to the base determines how far you open the faucet. But transistors all have a threshold voltage before they will even "turn on" just like a faucet has a slight turn before water will even start to drip out. Thus we have a switch now. Various types of transistor have different turn-on or turn-off thresholds. On a 2n3904, it is about 0.7v. So you can have a system where a very small voltage & current is applied to this part, and it can then turn on a larger part with a higher voltage and amperage without interacting in a negative way, just like a relay. A PNP transistor works the same way, only it is always ON and current will turn it off when current is applied to the Base when used as a switch, so it is intended for inverted operation.
Next, notice the arrow in the picture, transistors will only flow in the direction that the arrow is pointing like a diode.
Used as an amplifier, transistors work the same way with current applied to the base, only they are always ON (threshold always turned on) so the signal is always passing thru, and they make use of the dynamic current changes coming into the Base.
Think of an electric guitar plugged right into the base. The pickup of an electric guitar needs to be amplified. By itself, a guitar pick-up will create a very low voltage/current when you strum it. But by taking that small current and running it into the base of a transistor and putting a larger voltage & current on the Collector, you now have an amplifier. You can stack transistors and increase their amplification too. This is called a "Darlington Pair". TIP102 transistors in our pins are Darlington Transistors. It is nothing more than 2 transistors stacked and a few resistors and a diode in a little square package.
TIP102.jpg
Transistors.jpg
If this is helpful, I'll keep going, otherwise I'll shut up.