A Lightweight Radioisotope Heater Unit is a device used by NASA that provides low levels of heat to spacecraft. It is different than a Radioisotope Power Generator, which uses a radioisotope to generate heat that then powers electrical systems. The Lightweight Radioisotope Heater Unit is only to generate a small level of ambient heat to keep some systems working. Also like the Radioisotope Power Generator, it uses Plutonium-238 as a power source, protected by metal clading and then several layers of graphite that cause the heat to gradually spread.
Despite the popular images of plutonium as "glowing green", and highly energetic, the small amount of Plutonium-238 in each Unit is small enough that it only outputs one watt of heat: about as much energy as a night light or television in standby mode. It isn't much heat, until we compare it to how cold space can be. This is also the output per unit: some spacecraft have used multiple units, with the Galileo Probe, for example, using 120 of them. Plutonium-238 also has a half-life of over 87 years, meaning that even on a decades-long spacecraft mission (such as with the Voyager Probes), the output will still be strong.
Also, because the units are small, and very well shielded, even a catastrophic flight event---ie, an explosion, would probably not leave the heater units posing a danger, at least not in comparison to the danger posed by tons of exploding rocket fuel.
https://rps.nasa.gov/power-and-thermal-systems/thermal-systems/light-weight-radioisotope-heater-unit/