As many other answers have said, the sun is held together by gravity. As a hydrogen atom rises towards the surface, it slows down like any other rising projectile. read more
Think of the sun and its planets all as proto spheres of matter pre birth of our sun. Gas and heavier elements attracted to each other by gravity. read more