This is not really my field but i believe that stars are formed from clouds of dust and gas in space which clump together due to gravity. A star forms once it is hot enough for nuclear reactions to take place and this keeps the star hot. Hope that helps 🙂
Comments