Well, the answer is complicated, as there are many problems. The amount of stars in the universe is very theoretical, and most of it is unknown. There are many possibilities in how the universe could have formed and many options in how it exists. It could be infinite( which is not so crazy as it sounds). It could be a specific size. The universe we can observe currently is called the observable universe, and we are confident that the actual universe is larger.
The first theory, which is widely accepted by the scientific community, is the big bang theory. The big bang was a release of energy rather than an explosion. This release of energy happened from a singularity, which is a POINT with INFINITE MASS. The universe then, for a few seconds (after the big bang), was a quark-gluon plasma, which is when the temperature is so high that gluons cannot hold onto the quarks. The rest is translated into a jumble of subatomic or at least for not "fundamental particles." Then more complex subatomic particles were formed like electrons, protons, and neutrons. The universe expanded quickly, and eventually, atoms started to form, then this went to dust to compounds to rocks and when those rocks became large enough and attracted each other, planets were formed then stars, and when massive stars died, black holes were born. Wait, But Vuk, how could something form from nothing. A few ways and a few theories on why this would have happened, I will get into this in my second paragraph.
The singularity, as I mentioned, is a point with zero volume but infinite mass. Wait, Whaaaaaaaaaaat!!! This is not as crazy as it sounds; let me explain. The singularity is essentially an infinitely large point. A point is a zero-dimensional plane. Since mass only applies in the third dimension, a singularity is a point that applies in 0D. But how could this have happened? Well, maybe we misunderstand what nothing is. Currently, nothing is the absence of matter, but what if everything was the matter. Then, with our perception, nothing would be something. As far as we know, the idea of nothing has properties; however, we have classified those properties as being something. Does this sound fishy or weird to you? Well, maybe we came from a higher dimension, and the big bang theory is not valid. Then "matter" from other higher or lower dimensions could have values that very much exist in our world. Let's look at an example in our world to make it easier for you to understand.
The area of a plane in the second dimension is, let's say x; in the third dimension, all that x would be zero, and it would mean nothing. From the third dimension, we could take as many second dimensional planes and make it second dimensional. We could do this infinitely and not lose a single bit of volume, which is relevant in the third dimension. Therefore, we can put an infinite amount of second-dimensional planes in a second-dimensional universe giving it an unlimited size. But, this is not even just a constant in the third dimension and second dimension. The same applies to lines compared to second-dimensional planes. Also, it applies to the number of points in lines. THIS IS AN INTERDIMENSIONAL CONSTANT!!! Why should the same not apply to the third dimensional and the fourth dimension? If we take in this logic, we can ensure that the universe we live in now can and is most likely even infinite.
Now, you may ask why could something in the universe even form. Well, we could take multiple routes. First, we can take into account the quantum foam. Quantum Foam is the idea that something can exist; however, the amount of time it exists is correlated with how long it can live. This is a possible explanation of how the universe came to be; however, I am not a big advocate for this theory. I think that this is true to an extent, but the particles instead form from smaller particles and that it is just that the more prominent and significant they are, the faster the decay, which is a whole other topic. It could also be a Schrodinger's cat situation. There it states that it either does happen or it doesn't happen. Essentially, there is either a 100% chance of something happening or a 100% chance of it not happening. Essentially because the universe exists in our world, there is a hundred percent chance of a universe existing, and if there were no universe, there would be a zero percent chance of the universe existing.
Thankfully we likely have a bright future ahead of us. Moore's law, a philosophy, states that we advance more quickly as we age as a civilization. With the launch of the James Webb Telescope and research papers and theories being published and proposed every day, we expect to learn much more about the universe and reality that we live in.