Its easy. The "beginning" of all things in our universe was the Big Bang. It set into motion the formation of the elements, formation of galaxies, solar systems, planets from gravitional forces, etc..
After the Big Bang space expanded like a balloon being blown up. At first things were too hot, but as it expanded the temperature cooled down enough for the elements to form. Once the elements formed this provided enough matter to begin gravitational attraction. At first there were planetestimals (essentially small rocks), some matter collapsed together to form suns, etc.. In some places there was so much matter that black holes formed, because the gravitational forces were so strong that even light could not escape.
We know there was a Big Bang because the universe is expanding and because of the background radiation, which was predicted by the Big Bang theory before it was even discovered.