A tutorial introduction to the statistical mechanics of phase transitions and phase coexistence is presented, starting out from equilibrium systems and nonequilibrium steady-state situations in externally driven systems, such as unmixing of sheared binary fluid mixtures, the driven lattice gas model, and the onset of Rayleigh-Bénard convection. Then, some models for phase separation in models for active systems, where particles possess internal motility, are discussed, emphasizing what one can learn by extending analysis methods to study phase transitions in equilibrium systems by computer simulations to active systems. Specific examples will include colloidpolymer mixtures where the colloids are assumed to be active particles, and active Brownian particles. The extent to which concepts familiar from the study of equilibrium systems are still useful will be critically discussed.