Formation of Stars
A star begins its life as a very large cloud known as a Giant Molecular Cloud. These clouds are many light years across and have many thousands to millions times more matter than our sun. As they continue, some areas begin to condense and if there is sufficient external influence (like a nearby star exploding) then regions will form a swirling mass of matter known as a protostar.
Not all of these protostars will have enough energy to fuse hydrogen (see below) and thus will become a brown dwarf. In those protostars that do have enough energy, the hydrogen particles that make up the vast majority of the star will bash in to each other and join to make helium (i.e. the hydrogens have fused). This will produce energy.
The outward energy being created by this balances against the gravitational energy pulling inward, so that overall the star maintains its size
Fate of Stars
What happens after the star has completed fusion depends on its mass, so below we have a brief summary of what happens to small, medium and large stars (for reference the sun is a small to medium star).
A small star it has been calculated that not even the universe is old enough for these stars to have stopped fusion. However scientists believe that the star will gradually collapse into a white dwarf which is a star about the size of earth but the mass of the sun (therefore it is dense) these will gradually cool as they don't produce energy.
medium stars will expand and then contract relatively quickly when they begin helium fusion. Carbon and Oxygen can be fused just outside of the core, and in time the outer layers of helium are 'ejected', this leaves a white dwarf.
The death of large stars is much more spectacular. Because of its huge mass, it can reach very high temperatures which means that many atoms degrade and the smaller atoms then fuse. However, when iron fusion happens, the process consumes energy. This means that the star suddenly collapses into a neutron star (a very small and extremely dense star) or a black hole for stars that were extremely large. This collapse is accompanied by a supernova, which is, in effect, a star exploding.