From Encyc

A star is a large ball of gas which emits an enormous amount of energy, created by nuclear fusion.

Stars form when interstellar gas clouds collapse under their own gravitational self-attraction. Such clouds consist predominantly of hydrogen. As the cloud shrinks, it heats up since its gravitational energy is converted into thermal energy. When its centre reaches a temperature of a few million degrees, nuclear fusion starts, converting hydrogen to helium. The star then stops shrinking, and remains in a stable state, radiating energy.

The brightness of a new-born star depends on its mass; the more massive it is, the hotter and brighter it is. Its period of stability decreases with increasing mass. A star with the mass of the Sun remains stable for around 10 billion years. Less massive stars are dimmer and cooler, hence use their hydrogen less rapidly and can remain stable for even longer. Stars with many times the Sun's mass shine so brightly that they may only last for a few million years.