A star (or "sun") is a massive energy-producing sphere of plasma and gas located in space. The region around a star that is held by its gravity, including any planets, moons, comets, and asteroids, is called a star system.
Stellar life cycle
Stars are born out of huge gaseous nebulae. Inside these nebulae, centers of higher density form, slowly accumulating more mass as the center's gravity increases, to form a protostar. Pressure in the interior of the protostar rises, in turn increasing the density and temperature until the gas turns to plasma, where the atomic nuclei and the electrons are dissociated from each other. At a sufficient temperature and pressure, nuclear fusion is initiated at the core, producing light: the star is born.
Stars can be made up of various different elements depending on their age.
Young stars mainly consist of hydrogen, which is fused to helium thereby increasing the star's helium ratio over time and producing large quantities of energy. This energy, in turn, creates extreme pressure, preventing the star from collapsing under its own gravity.
As a sun gets older it begins to fuse heavier elements, like helium, as the lighter elements like hydrogen are depleted. This, however, releases more energy, causing the star to swell, which increases its surface area from which the energy is emitted. This phase marks the beginning of the star's end.
Because of its larger surface area, the star turns red and is then called a red giant. After the sun runs out of light elements and the number of fusion reactions decreases, its own gravity causes it to collapse and to expel its outer layers of matter, creating beautiful "planetary nebulae". The remnant of the star is called white dwarf.
Every star has to pass these stages of evolution. However, depending on their masses, some suns experience further changes.
Below 1.5 Sol masses: After 1-10 billion years any nuclear reactions
inside the white dwarf finally cease and the star turns to a "black
dwarf", a very small stellar corpse.
Above 1.5 Sol masses: The white dwarf swells again, fusing all elements
up to iron. After the last iron is depleted, the star turns into a supernova,
where the outer layers of the sun explode, which, in turn, causes a
massive shock wave. The remains of this explosion are a vast matter
nebula and a tiny neutron star, which is so dense, that all protons
and electrons are neutralized to neutrons. A special form of neutron
stars are pulsars.
If the remnant of a supernova is more massive than 2.5 Sol masses,
it collapses to a black hole.
Stars are assigned to different spectral classes & types.
See the original version at Memory Alpha