A star forms from a cloud of gas and dust called a nebula. As the nebula contracts and heats up, it eventually reaches a temperature and density where nuclear fusion can occur, igniting the star.