How do protostars primarily gain internal temperature during their earliest formation stages?

Answer

Gravitational accretion of collapsing gas and dust

A protostar represents an object in the nascent phase of stellar formation, currently situated within a dense, collapsing cloud of gas and dust. At this stage, the object has not yet reached the core temperatures required for nuclear ignition. Its internal energy and corresponding rise in temperature are derived entirely from the process of gravitational accretion—as material falls inward onto the growing core, the conversion of gravitational potential energy into thermal energy dramatically heats the interior until fusion conditions are potentially met.

How do protostars primarily gain internal temperature during their earliest formation stages?
processstellarstarFusionnuclear