In 1923 Edwin Hubble resolved a Cepheid Variable star in the Andromeda nebula. By using Leavitt's Period/Magnitude relationship he calculated the distance to be several million light years. This put the Andromeda nebula well outside the bounds of our own galaxy and proved that it was a separate system of stars, a galaxy of it's own, very far away from us.
Over the years Hubble observed many other galaxies and was able to calculate their distances either using Leavitt's formula or though other, less direct means. He was able to construct a crude three dimensional model of the galaxies in our local group.
But he also measured their spectra, and he found that the farther a galaxy was from us, the more its spectra was doppler shifted towards the red. A red doppler shift implies that the galaxy is moving away from us. The relationship was strictly linear. Twice the red shift meant twice the distance. And this relationship held for every galaxy he observed except for those that were very "close" to us.
This observation has mostly held true ever since. The farther away a galaxy is from us, the more it is red shifted, implying the faster it is receding from us. The velocity of recession is proportional to distance.
Only one behavior allows velocity to be proportional to distance. Expansion. The universe is apparently expanding.
Einstein's theory of General Relativity had predicted this over a decade earlier; but Einstein was so troubled by the idea that he fudged his equations so that the expansion was erased. He later called this is greatest error.
The idea an expanding universe was troubling to others as well. What is it expanding into? Worse, what did it look like during earlier epochs? It must have been smaller. How small could it have been?
Our answer to that question came in the subsequent decades. In the '40s Alpher, Bethe, and Gamow showed that the observed relative abundances of isotopes Hydrogen, Helium, and Lithium in the universe were consistent with the entire universe rapidly expanding through a period where the density and temperature were equivalent to the core of a star burning Hydrogen into Helium.
Then, in the late 40s, Alpher, Herman, and Gamow showed that the universe should have cooled, between then, and now, to a temperature of about 5°K.
Finally, in 1964, Penzias and Wilson accidentally discovered the black-body microwave radiation produced by that ~5°K temperature -- the Cosmic Microwave Background.
Given these three lines of evidence it is reasonable to conclude that long ago...
The whole universe was in a hot dense state...

Source: x.com/unclebobmartin/status/1830293918967083385