Our understanding of stellar evolution and the final explosive endpoints such as supernovae or hypernovae or gamma-ray bursts relies on the combination of a) (magneto-)hydrodynamics b) engergy generation due to nuclear reactions accomanying composition changes c) radiation transport d) thermodynamic properties (such as the equation of state of stellar matter).Hydrodynamics is essentially embedded within the numerical schemes which implement the physics of processes (b) to (d). In early phases of stellar evolution, hydrodynamical processes can be approximated by a hydrostatic treatment. Nuclear energy production (b) includes all nuclear reactions triggered during stellar evolution and explosive end stages, also among unstable isotopes produced on the way. Radiation transport (c) covers atomic physics (e.g. opacities) for photon transport, but also nuclear physics and neutrino nucleon/nucleus interactions in late phases and core collapse. The thermodynamical treatment (d) addresses the mixture of ideal gases of photons, electrons/positrons and nuclei/ions. These are fermions and bosons, in dilute media or at high temperatures their energies can often be approximated by Maxwell-Boltzmann distributions. At very high densities, the nuclear equation of state is required to relate pressure and density. It exhibits a complex behavior, with transitions from individual nuclei to clusters of nucleons with a background neutron bath, homogeneous phases of nucleons, the emergence of hyperons and pions up to a possible hadron-quark phase transition.The detailed treatment of all these ingredients and their combined application is discussed in more depth in textbooks (Kippenhahn and Weigert, 1994; Maeder, /or the preceding Chapter (3), where the evolution of low and intermediate mass stars is addressed. That chapter also includes the stellar structure equations in spherical symmetry and a discussion of opacities for photon transport. Ch. 8 and 9 (tools for modeling objects and their processes) go into more detail with regard to modeling hydrodynamics, (convective) instabilities and energy transport as well as the energy generation due to nuclear reactions and the determination of the latter. Here we want to focus on the astrophysical aspects, i.e. a description of the evolution of massive stars and their endpoints with a special emphasis on the composition of their ejecta (in form of stellar winds during the evolution or of explosive ejecta). Low and intermediate mass stars end their evolution as AGB stars, finally blowing off a planetary nebula via wind losses and leaving a white dwarf with an unburned C and O composition. Massive stars evolve beyond this point and experience all stellar burning stages from H over He, C, Ne, O and Si-burning up to core collapse and explosive endstages. In this chapter we want to discuss the nucleosynthesis processes involved and the production of radioactive nuclei 5 in more detail. This includes all hydrostatic nuclear-burning stages experienced by massive stars, and explosive burning stages wh...