Stars begin to form from clouds of gas in space. The cold temperatures and high densities (compared to elsewhere in space, but would be considered a vacuum on Earth) of these clouds allow gravity to overcome thermal pressure and start the gravitational collapse that will form a star.