How do we know the life cycle of a tree...?
When you walk through the forest, you see pine cones, and dead, fallen trees, and saplings, and large pines standing tall... logically, we can deduce that these are different phases of trees - from birth to death.
We do the same thing with stars... we can look out and see stars in various stages of their time on the main sequence; we see 'stellar nurseries' where stars are being formed, we see early stars surrounded by gas and dust, and (recently, at least) we see stars with planetary systems. In death, we see white dwarfs, neutron stars and black holes...
Our sun is a dwarf star; small, when compared to others; it won't have the mass to explode at the end of it's life - it'll swell up as it begins to die in the 'red giant' phase, and slough off it's outer layers; at the end of it's life, only it's core will remain, a white dwarf about the size of Earth - which will cool slowly over billions of years.