Stars last a long time, but eventually they will die. The energy that make up stars, some of the largest objects we ever study, comes from the interaction of individual atoms. So, in order to understand the most large and powerful objects in the universe, we must understand the most basic. Then, as the star's life ends, those basic principles once again come into play to describe what will happen to the star next.
The Birth of a Star
The stars took a long time to form, as gas drifting in the universe was drawn together by the force of gravity. This gas is mostly hydrogen, because it's the most basic and abundant element in the universe, although some of the gas might consist of some other elements. Enough of this gas begins gathering together under gravity and each atom is pulling on all of the other atoms.
This gravitational pull is enough to force the atoms to collide with each other, which in turn generates heat. In fact, as the atoms are colliding with each other, they're vibrating and moving more quickly (that is, after all, what heat energy really is: atomic motion). Eventually, they get so hot, and the individual atoms have so much kinetic energy, that when they collide with another atom (which also has a lot of kinetic energy) they don't just bounce off each other.
With enough energy, the two atoms collide and the nucleus of these atoms fuse together. Remember, this is mostly hydrogen, which means that each atom contains a nucleus with only one proton. When these nuclei fuse together (a process known, appropriately enough, as nuclear fusion) the resulting nucleus has two protons, which means that the new atom created is helium. Stars may also fuse heavier atoms, such as helium, together to make even larger atomic nuclei. (This process, called nucleosynthesis, is believed to be how many of the elements in our universe were formed.)
The Burning of a Star
So the atoms (often the element hydrogen) inside the star collide together, going through a process of nuclear fusion, which generates heat, electromagnetic radiation (including visible light), and energy in other forms, such as high-energy particles. This period of atomic burning is what most of us think as the life of a star, and it's in this phase that we see most stars up in the heavens.
This heat generates a pressure - much like heating air inside a balloon creates pressure on the surface of the balloon (rough analogy) - which pushes the atoms apart. But remember that gravity's trying to pull them together. Eventually, the star reaches an equilibrium where the attraction of gravity and the repulsive pressure are balanced out, and during this period the star burns in a relatively stable way.
Until it runs out of fuel, that is.
The Cooling of a Star
As the hydrogen fuel in a star gets converted to helium, and to some heavier elements, it takes more and more heat to cause the nuclear fusion. Big stars use their fuel faster, because it takes more energy to counteract the larger gravitational force. (Or, put another way, the larger gravitational force causes the atoms to collide together more rapidly.) While our sun will probably last for about 5 thousand million years, more massive stars may last as little as 1 hundred million years before using up their fuel.
As the star's fuel begins to run out, the star begins to generate less heat. Without the heat to counteract the gravitational pull, the star begins to contract.
All is not lost, however! Remember that these atoms are made up of protons, neutrons, and electrons, which are fermions. One of the rules governing fermions is called the Pauli Exclusion Principle, which states that no two fermions can occupy the same "state," which is a fancy way of saying that there can't be more than one identical one in the same place doing the same thing. (Bosons, on the other hand, don't run into this problem, which is part of the reason photon-based lasers work.)
The result of this is that the Pauli Exclusion Principle creates yet another slight repulsive force between electrons, which can help counteract the collapse of a star, turning it into a white dwarf. This was discovered by the Indian physicist Subrahmanyan Chandrasekhar in 1928.
Another type of star, the neutron star, come into being when a star collapses and the neutron-to-neutron repulsion counteracts the gravitational collapse.
However, not all stars become white dwarf stars or even neutron stars. Chandrasekhar realized that some stars would have very different fates.
The Death of a Star
Chandrasekhar determined any star more massive than about 1.4 times our sun (a mass called the Chandrasekhar limit) wouldn't be able to support itself against its own gravity and would collapse into a white dwarf. Stars ranging up to about 3 times our sun would become neutron stars.
Beyond that, though, there's just too much mass for the star to counteract the gravitational pull through the exclusion principle. It's possible that when the star is dying it might go through a supernova, expelling enough mass out into the universe that it drops below these limits and becomes one of these types of stars ... but if not, then what happens?
Well, in that case the mass continues to collapse under gravitational forces until a black hole is formed.
And that, my friends, is what you call the death of a star.