On small scales, astronomers understand how stars are born.
You start with a nebula — a big cloud of gas and dust — and compress it somehow. Maybe it collides with another cloud, or a nearby star explodes, or a massive nearby star slams it with its powerful solar wind. Then physics takes over, with the cloud (or parts of it) collapsing down, flattening out, then forming a disk with a star (or multiple stars) in the middle. Eventually the center gets dense and hot enough to start fusing hydrogen into helium. A star is born.