Star formation is triggered and occurs when a dense region of dust and gas in space collapses under it's own gravity.
Stars form when a molecular cloud or stellar nursery reaches a critical mass, then the cloud collapses due to gravity, friction then heats the material and causes it to form a protostar, the protostar's core then heats up to millions of degrees and the protostar spontaneously fuses hydrogen atoms to form helium, releasing energy.
A protostar is what is before a star and is a dense clump of gas and dust which forms within a nebula, which is a cloud of gas and dust in space, when gravity pulls the material together and starts to heat up.
Once the core of the protostar reaches a high enough temperature, then nuclear fusion begins and it then becomes a full fledged star.
The hottest stars are blue in color.
The color of a star is directly related to the temperature of the star and blue signifies the hottest stars and red signifies the coolest stars.
When stars age the stars lose mass, expand and then eventually they cool and turn into white dwarfs, neutron stars or even black holes.
Stars go through stages of stellar evolution which includes the main sequence in which stars shine brightly as they fuse hydrogen in their cores, the red giant in which stars expand and cool and turn red and become more luminous and white dwarf which is when stars become dense, earth sized stars which gradually cool over billions of years.
The energy when a star dies goes out into space as a shockwave.
When the star dies the stars energy gets released in the form of a supernova explosion and is ejected into space as a shockwave.
As a result it carries the star's material including any newly created heavy elements with it and becomes part of the interstellar medium that can then be used to form new stars.
The remaining core of the star can then become a white dwarf, neutron star or even a black hole depending on it's initial mass.
Stars run out of fuel although it can take millions to trillions of years for the star to run out of fuel.
Stars run out of fuel when the hydrogen that is in the stars core is depleted.
Nuclear fusion is the primary source of energy and fuel for stars and when the nuclear fusion is depleted and leaves the star it is unable to generate any further heat and light.
As a result the star's core collapses inward as a result of gravity and eventually it expands it's outer layers and transforms it into a red giant depending on it's initial mass.
Nuclear fusion can generate energy for a very long time which is why they can continue to have the energy for millions or trillions of years.
The lifespan of a star is millions to trillions of years.
The actual lifespan of a star depends on the mass of the star.
Low mass stars often live for trillions of years and massive mass stars live for millions of years.
Massive stars use up their hydrogen fuel quickly which results in shorter lifespans.
Low mass stars are very faint and can live longer than the universe as actually existed.
The reason why stars twinkle but planets don't is because they are very far from the earth and so the stars appear as points of light and planets appear as disks.
Stars appear as pinpoints of light and twinkle in the night sky because they are so far away from earth.
The light from the stars is also more easily disturbed by the Earth's atmosphere which causes it to refract and change direction and makes the stars appear to twinkle.
Planets don't twinkle because the planets are closer to Earth and so the planets appear as larger and extended sources of light.
The light from different parts of the planet are refracted in slightly different ways, which then cancels out the affect of twinkling.
Stars are really burning balls of gas even though they don't really appear to be from earth.
The stars that we see in the sky are huge spheres of hot gas which mostly consists of hydrogen gas which generate light and heat through a process that is called nuclear fusion.
The nuclear fusion happens in the stars core, where hydrogen atoms combine and form helium.
When the hydrogen atoms combine to form helium in the stars core it releases energy in the process.
As a result the stars glow and the stars appear in the sky and shine through the night sky.
Stars are mostly hydrogen with some helium and a trace amount of heavier elements.
Nuclear fusion is the energy source of stars in which hydrogen atoms fuse into helium and release energy.
A star's immense gravity pulls the gas inwards and creates the pressure that is required for the fusion to occur.
And the light that you see from stars is the energy that is being produced by the fusion escaping from it's surface.
Stars that are fusing hydrogen to helium in it's core is called a main sequence star.
Main sequence stars make up around 90 percent of the universe's stellar population.
And they range in size, color and luminosity, from a 10th to 200 times the mass of the Sun and live for millions to even billions of years.