"The theory of general relativity tells us that all matter and energy interact gravitationally both by producing their own curvature and by moving on geodesics caused by existing curvature"" (e.g. Duncan and Tyler 2009). With this in mind, someone may ponder how an object can hold itself up against its own gravity. Objects lets say like our Sun or more massive stars, which are made up of many atoms and other particles, which follow geodesics all the time. Why don't these atoms and particles fall to the center of the Sun's curvature? Well the answer isn't directly why these stars don't collapse, but in fact when they will collapse. .
The life of a star begins from clouds of dust and gas called nebulae. Matter in the nebulae will begin to collapse into a dense region due to gravity. This leads to protostars, which continues to condense and increase in temperature, eventually reaching a critical mass where nuclear fusion begins. This begins the main phase of a star where it spends most its time in a stable position. The more massive the star means more gravity and tremendous temperature and pressure which speeds up the process of fusing hydrogen into helium. In time stars begin to run out of hydrogen in their core and, "Can no longer generate enough nuclear energy to supply the heat and pressure needed to resist gravity, and hydrostatic equilibrium is broken"" (e.g. Duncan and Tyler 2009). Gravity begins to set in collapsing the star and actually causing the core to heat up because of the gravitational energy. The heat causes the star to expand even while the core shrinks. The star grows and the surface cools down going into the phase of a red giant. The core continues to heat up getting to a point where nuclear fusion can resume. .
High-mass stars, those greater than 10 solar masses, require greater pressure, "So their cores must be hot enough to fuse heavier elements after hydrogen becomes helium and helium becomes carbon"" (e.