The Sun, like every other star, started its life as a giant cloud of mostly hydrogen gas. This cloud slowly condensed and collapsed under the force of gravity until there was enough pressure at the core to commence nuclear fusion, and the Sun turned on.
Compared to other stars, our Sun is quite average. If we plot all the different kinds of stars by their temperature and brightness, the Sun sits neatly in the center. Given its size and age of 4.5 billion years, the Sun is roughly halfway through its main sequence lifetime, the period when it converts hydrogen in its core to helium.