It heats because it is not saturated. (you can measure a Vce = ??... to high.. should be below 1V)
Increace base current to achieve saturation. => reduce resistor value, but never below 100 Ohm
.............
from datasheet Vbe=1,3V
(5V-1,3V)/R = max 40mA => R=100