Just like any star before it was a star. It was most likely a nebula.
Stars are formed when nebulas come under a gravitational force causing the nebula to clump together. The dust spins fast enough to form a mass in the center and draw in more material. This is called a protostar. The protostar eventually becomes hot enough to start fusing hydrogen atoms. After a few million years a blast occurs shooting the remaining dust away.