Your microcontroller pin delivers signals, not power. An LED on a pin is just about acceptable if you keep the current low. A motor, a relay or an LED strip — then you need a switching component. And that quickly comes down to two options: a transistor or a MOSFET.
They both do the same thing in principle: use a small signal to switch a large current. But how they do it, and when one works better than the other, is what determines whether a project works or not.
The bipolar transistor: current drives current
An NPN transistor like the BC547BTA operates on base current. You drive the base through a resistor, and that small base current controls a much larger current between collector and emitter. The gain factor (hₐₑ) for the BC547 is typically 110 to 800 depending on the variant.
That makes transistors perfectly suitable for small loads: a 50 mA relay, a buzzer, an indicator LED with some extra current. Simple circuit, few components, easy to understand.
The downside: base current always flows. It's small, but not zero. And the voltage between collector and emitter in conduction (V₀₁) is typically 0.2 to 0.6 V — that's heat at higher currents.

The MOSFET: voltage drives current
A MOSFET is controlled by voltage on the gate, not current. In conduction, the gate draws virtually no current from the pin. That's efficient, and it makes the MOSFET suitable for PWM, higher currents and battery-powered systems.
For makers, the IRLZ44NPBF is a classic choice: logic level N-channel, 55 V, 41 A in TO-220. The low Rds(on) of 22 mΩ means minimal heat even at serious currents. With over 44,000 units in stock it's readily available.
Note that the IRLZ44N is a powerful MOSFET. For a small relay or an LED strip drawing a few amps, a smaller variant like the IRLZ34NPBF (55 V, 27 A) is sufficient.
The Vgs(th) trap
Datasheets list Vgs(th): the gate threshold voltage. That's the point where the MOSFET starts to conduct, not where it's fully on. At Vgs(th) the resistance is still high and heat dissipation is significant.
Look at Rds(on) at the gate voltage you'll actually use — typically 3.3 V or 5 V from a microcontroller. A logic level MOSFET is specifically designed to work well at these low voltages. A standard MOSFET may still be half-closed at 3.3 V.
Heat and protection
Switching an inductive load — motor, relay, solenoid — requires a flyback diode. When the MOSFET switches off, the coil generates a voltage spike that can damage the MOSFET. The 1N4007G placed antiparallel across the load does the job: simple, cheap, effective.
Summary
Transistor for small, simple loads where simplicity matters. MOSFET for power, PWM and efficiency. Always check whether it's a logic level type, look at Rds(on) at your actual gate voltage, and don't forget the flyback diode for inductive loads.