The sun doesn't collapse from its tremendous gravitational pressure because that pressure is balanced by the energy produced in its internal fusion reactor. First, two hydrogen nuclei fuse into deuterium, which then fuses with another hydrogen nucleus to make helium-3.
There are a few possible paths from this point, but most commonly two helium-3 nuclei fuse to make helium-4, with a couple of hydrogen nuclei left over to be used again. What is this process called?