How the sun formed . . . This is covered in chapters 7 and 13, both of which we will cover later in the quarter so just the quick version here. Our sun and solar system started 4.6 billion years ago . This cloud was just sitting around, much like other clouds we see out in space today. Then the cloud began to collapse due to gravity.
Gravity pulls things together.
When I let go of this eraser, gravity pulls it and the earth together. The eraser gains energy as it falls, the energy becomes heat and sound when the eraser hits the floor. Now imagine tons of material falling together, falling a distance equal to the earth-sun distance. Most of the material in the nebula falls into the center. That's where and how the sun formed.