The Saturn V, for example, was flown unmanned twice before it was deemed safe enough to put people on it.
in some ways the third flight was a "Hail Mary" pass, that second SaturnV flight was pretty hairy, but then there was a huge infrastructure of people and materials that pulled a lot of all-nighters to fix problems. Impetus was spy sat photos showing a really huge rocket at Baikonur, shortly after it was no longer there. Higher ups were thinking Soviets just test launched a Saturn V class rocket (they didn't know that at the time it blew up). So gotta beat the Reds to the Moon, and lunar module was not ready for a flight, and Apollo 8 was scheduled. I clearly remember on TV, "and that was the TLI burn that will send them to the Moon." In an instant the world was completely different. Especially after a terrible year, some good news particularly the famous earthrise photo.