We study the evolution of the core (r<1 kpc) and effective (r<r_e) stellar-mass surface densities, in star-forming and quiescent galaxies. Since z=3, both populations occupy distinct, linear relations in log(Sigma_e) and log(Sigma_1) vs. log(M). These structural relations exhibit slopes and scatter that remain almost constant with time while their normalizations decline. For SFGs, the normalization declines by less than a factor of 2 from z=3, in both Sigma_e and Sigma_1. Such mild declines suggest that SFGs build dense cores by growing along these relations. We define this evolution as the structural main sequence (Sigma-MS). Quiescent galaxies follow different relations (Sigma^Q_e, Sigma^Q_1) off the Sigma-MS by having higher densities than SFGs of the same mass and redshift. The normalization of Sigma^Q_e declines by a factor of 10 since z=3, but only a factor of 2 in Sigma^Q_1. Thus, the common denominator for quiescent galaxies at all redshifts is the presence of a dense stellar core, and the formation of such cores in SFGs is the main requirement for quenching. Expressed in 2D as deviations off the SFR-MS and off Sigma^Q_1 at each redshift, the distribution of massive galaxies forms a universal, L-shaped sequence that relates two fundamental physical processes: compaction and quenching. Compaction is a process of substantial core-growth in SFGs relative to that in the Sigma-MS. This process increases the core-to-total mass and Sersic index, thereby, making compact SFGs. Quenching occurs once compact SFGs reach a maximum central density above Sigma^Q_1 > 9.5 M_sun/kpc^2. This threshold provides the most effective selection criterion to identify the star-forming progenitors of quiescent galaxies at all redshifts.