Stars begin their lives as clouds of dust and hydrogen.
When the clouds become dense enough, frequently due to shock waves moving through the clouds, the material collapses and, if there is enough mass, the hydrogen undergoes an exothermic chain reaction creating in most cases a fairly stable star. The amount of time this collapse and ignition takes is strongly dependent on the mass of the cloud and its radius. After it begins, most stars spend the majority of their lifetimes using this reaction to fuse hydrogen into helium and to give off lots and lots of light. This strongly endothermic reaction causes the collapse of the stars core and frequently a spectacular explosion visible to observers on earth with the naked eye. We are however, unable to determine these facts from where we sit on earth directly, in part due to our distance from most stars and also due to the very long timescales, from a human perspective, over which these events occur.