The very early universe (within the first fraction of second after the big bang) consisted of energy and particles of matter and antimatter. According to theory, confirmed by experiments at particle colliders, matter and antimatter particles are always produced as a pair and if they come in contact with each other they annihilate each other, leaving behind pure energy. In the first second after the big bang energy spontaneously created matter and antimatter pairs, then the pairs annihilated themselves converting back into energy and then the cycle repeated so that the young universe was buzzing with matter-antimatter pairs popping in and out of existence.
Then something occurred which caused the universe to have an asymmetry in which particles of matter outnumbered particles of antimatter just slightly. How slight? About a billion-and-one to a billion. What caused this asymmetry? There are a number of theories, but there is no known answer. Work at at the Large Hadron Collider is making progress in explaining the asymmetry. Here’s an article discussing the progress: https://arstechnica.com/science/2017/02/matter-antimatter-asymmetry-confirmed-in-baryons/

Large Hadron Collider at CERN
This slight 1,000,000,001 to 1,000,000,000 asymmetry of matter and antimatter created a net particle of matter after each billion matter-antimatter collisions. These lone unpaired matter particles (known as hadrons) survived to become the ultimate source of all matter in the known universe which allowed the creation of stars, planets, galaxies and dogs.
If this slight imbalance between matter and antimatter had not occurred, all mass in the universe would have self-annihilated. A universe with no matter would be just energy – just pure light. Just one of many things that had to be “just so” for us to be here. Related IFOD on the Anthropic Principle: http://www.theifod.com/isnt-it-amazing-that-we-exist/
As Freddy Mercury sang:
Nothing really matters…to me.