As soon I sent in the reply, whole thing started to smoke. With the 3 pins of my breadboard under the mosfet most defs melted haha.Expanding on lan0 comments, the TIP31CG (or any BJT) requires base current to operate. The output current from a MCU output pin is very limited and can't provide the base current required for the BJT transistor to operate. A mosfet doesn't require much current (micro amps) to operate and can provide as much, or more, current to the load. The internal structure of the mosfet between the source and drain can be thought of as a resistor that, in your application, changes (when switched off to on via voltage applied to the "gate") from a very high value (mega ohms) to a very low value (usually milli ohms). If chosen correctly, the mosfet will not require heatsink. VGS(th) is a specified voltage threshold value that is the voltage required to turn the mosfet "on". The sim below shows the circuit status with the mosfet "on".
View attachment 319652