As core shrinks and temperature rises, energy emitted in the infrared. Overview of the Build-up Collapse starts out in free fall controlled by gravity. Core accretes material from the surrounding envelope. The protostar continues to collapse while the central core heats up to millions of degrees. Collapse is halted by the pressure of the heated gas and radiation which counteract gravity.
Pressure is force in outward direction, gravity is force pulling star in.
An equilibrium is reached between opposing forces. The time for a star to reach the main-sequence varies with its mass. Cone Nebula Horsehead Nebula rho Oph.