For the moment, I'm going to lump together transistors, FET's (Field Effect Transistors), and relays. There are some other devices that could be lumped in there as well, but...
At the most basic level, all of these devices operate as a switch. Do something, and electricity will start or stop flowing. Stop doing something, and the electricity flow will change.
A relay is the easiest for beginners to understand. Current flowing through the coil causes an electromagnet to become magnetized. This makes a mechanical switch "flip". Turn off the current in the coil and the switch flips the other way.
In the case of a transistor, when current flows through one of the pins (called the "base") it causes more current to flow through the other two pins (the pins are called the collector and emitter). No current through the base means that there is no current flowing through the other two pins.
A FET is similar to a transistor, but instead of a current flowing through the base, it is a voltage on the base. And just to confuse matters the pins are not called Base, Emitter, and Collector. Instead they are called Gate, Source, and Drain. But the operation is very similar. Have the correct voltage on the Gate and electricity will flow through the other two pins. Don't have the correct voltage and the flow will stop.
Another important detail is that the transistor or FET doesn't have to be "fully on" or "fully off". If the Base or Gate is somewhere in between fully on & off, then the flow of electricity through the device will be "a little on" or "a little off". This doesn't work for relays.
And that's the beginner level explanation. Of course I glossed over a lot of details, but they are not important at this stage. What is important is that you can take Transistors and FET's and combine them in interesting ways to make all the cool electrical devices that we can't live without.