Our Sun is just one among many stars. It happens to be a fairly typical one, but many other kinds of stars exist as well.
Approximately 3000 stars are visible with the naked eye on Earth. At any one location this is maybe around 1000. Hipparcus, an ancient Greek astronomer, wrote a star catalogue with the positions of many of the stars known in his time. He divided the stars into six classes called magnitudes. First magnitude contains the brightest stars and sixth magnitude constains the ones just barely visible to the naked eye.
As the telescope was invented and fainter stars could be observed, the magnitde system was extended and finally given a formal definition through actual physical brightness values. Very dim objects go all the way to 20th magnitude or more, and very bright objects like the planets can be given negative magnitudes. Venus is around magnitude -4 and the Sun is around -27.
By imagining two stars to be at the same distance, the effect of distance on their brightness can be corrected, for so called absolute magnitudes, which is the usualy unit of measuring the brightness of various objects in the sky, including asteroids and comets.
After spectroscopy was developed, differences in the spectra were used to classify the stars. At first the different spectra were arranged arbitrarily in alphabetical order, but later it war realized that the different kinds of spectra correspond to different temperatures of the stars, and now the order is O, B, A, F, G, K, M. Astronomy is full of silly historical remnants like this.
The spectral class of a star is usually directly related to its brightness. When the brightness of stars is plotted against their temperatures (or spectral class), in what is known as the Hertzsprung-Russell diagram, most stars fall on a narrow line showing that cooler stars are less bright. This is known as the main sequence, and most stars lie on that line during most of their life.
The main exception from the main sequence are the red giants, which are very large but cool stars. They are both cool and bright, due to their enormous size.
Stars are formed when a large cloud of interstellar matter collapses. A denser part of the cloud will have stronger gravity and thus attract more gas, becoming denser and heavier.
When the density in the core of the collapsing gas becomes high enough, hydrogen atoms begin fusing together into helium atoms. This process produces energy, which heats up the rest of the gas. The energy produced by the nuclear reactions causes an outward pressure which counters the inward pressure of gravity, keeping the star stable. If the energy production weakened, gravity would increase the pressure, which would increase the nuclear reactions, and vice versa.
These fusion reactions go on in a small core inside the star, heating up the rest of the gas which forms the star. The mass of the forming star must be high enough in order for the pressure in the centre to start the nuclear reactions. This lower limit is around 0.08 solar masses.
The length of the lifetime of a star depends strongly on its mass. Heavy stars burn their fuel much faster than lighter stars and their lives are considerably shorter. A typical star like our Sun will stay in the main sequence for billions of years. Our sun is over four billion years old and will continue for maybe six billion more. A very light star can stay in the main sequence for ten trillion years (a thousand times the age of the universe so far), while a very massive star might only last for a few million years (a blink of an eye in geological time).
When a star runs out of hydrogen in the core, it begins dying. How this exactly happens depends on the mass of the star.
In very light stars the gas mixes effectively, and the hydrogen runs out pretty much all over the star simultaneously. The star is not massive enough to begin fusion of helium, so it contracts under its gravity, becoming a white dwarf. White dwarves are very small and very hot, dense balls of matter that glow with the remaining heat of the star for a long time.
In slightly more massive stars, the core runs out of hydrogen first, but fusion of hydrogen continues in a shell around the core. This causes the star to expand greatly, becoming a red giant. This does not take long, however, and the star soon fades out into a white dwarf like the smaller one.
In stars like our own Sun, the hydrogen shell around the core goes on burning for a longer time, with the helium ending up in the core, and eventually pressure in the core is high enough for the helium to begin fusion as well. The star goes through several changes in size and temperature and ends up blowing its outer layers into space to form a planetary nebula, a symmetrical gas cloud which is heated by the star remaining in the middle. Eventually the helium, too, run out and the star ends up a white dwarf like the lighter stars.
Very massive stars are able to fuse even heavier elements than helium, eventually producing an iron core. Fusion reaction go on in several concentric shells around the core, with lighter elements fusing in outer cores. Eventually, when the core is all iron, the fusion in the core stops. The core cannot take the pressure of the massive star around it and collapses into a denser state than white dwarves: a neutron star, or a black hole, depending on circumstances.
The collapse of of the core is a very violent process and the whole star explodes as a supernova. This releases a massive amount of energy: for a short while, the star is brighter than the other hundred billion stars of the galaxy put together. The supernova explosion also causes fusion reactions forming elements heavier than iron. This is the only way that elements heavier than iron are naturally produced in the universe.
In the beginning the universe consisted mostly of hydrogen and helium. All of the heavier elements that make up most of us and the world around us were created inside very massive stars and supernova explosions. This is what is meant by the common saying that "we are star-stuff" or "we are made of stars".