Problem connecting transistor, flybackdiode and relay
Most likely reason why your transistor has given off smoke is because you burned it out by exceeding its maximum current. This happened when you made the mistake of connecting 12V directly to collector of transistor and then turning on transistor in saturation mode (ie like closed switch). You essentially passed large current through transistor and shorted your supply at least temporarily. It would be helpful to know that for breadboard, horizontal lines starting from middle of board to each of the two longest sides of bread board are actually connected conductively. This is shown below. (Source: https://www.elprocus.com/a-brief-on-breadboard-basics-and-connections/). So  in your circuit, you have shorted the 12V to collector terminal of BJT and have completely bypassed the diode, and relay. This is indicated in the green circle in last image.
Also I should point out that you should double check your relay to make sure it’s just a relay and not relay module. A relay module might already have a diode and added transistor, and in that case may just require a logic signal to turn it on.

![enter image description here]