The universe consisted of hydrogen, helium and nothing else, after the Big Bang. Despite being formed from an incredibly hot, dense state, arbitrarily heavy elements weren’t created early on the same way they’re made today in stars.
The early universe, despite being hot enough to make pretty much anything, makes almost nothing for one reason. If it was hot and dense enough to fuse elements together in the very early stages, it was also hot enough to blast those composite elements apart again.
When the universe has cooled enough, elements aren’t immediately split apart. However, even after just a few minutes, conditions are so low in energy that almost all of the elements cap out at helium. Nothing is created beyond that until stars are formed.
Although the first stage of stellar burning always involves fusing hydrogen into helium in a star’s core, the stars that are massive enough will eventually build their way up the periodic table. When hydrogen and helium eventually run out of fuel in a star, it becomes a red giant and, in that process, hydrogen and helium form carbon and oxygen.