How was the universe formed?
We do not know for certain but the leading THEORY is that of the big bang.
The Big Bang theory is based on Einstein's theory of relativity, where matter and energy are related. The big bang theory begins with a extremely dense but small point of matter, which incredible amounts of energy. As Einstein's theory shows us energy can transform into matter, so this dense mass had such a large amount of energy that it's explosion lead to the creation of the matter of the Universe.
As the laws of conservation of mass and energy show us, neither mass nor energy can be created. Therefore the Big Bang isn't so much about the creation of the Universe as it is about the transformation of this almost immeasurable amount of energy being converted into matter.