They start out all wrapped up in these clouds, like blankets protecting them. But there is one thing about baby stars you might not expect. That is because the baby stars are formed out of those clouds, and gravity pulls them together to make a star. The baby star starts out big and cool, surrounded by clouds, so you can't see it. But as it gets older, it gets hotter and brighter.
Young stars get their energy from gravity.
They are slowly contracting, and as they squeeze together that generates energy which gets radiated away as light. It takes a star the size of our sun about 20 million years to reach this point. Once it starts nuclear fusion, the star can shine for about 10 billion years. It's not easy getting the age for a star. Using special instruments, we can find dark lines in the spectrum that correspond to the elements in a star.