In the past parents would hold say chicken pox parties, so all the kids would get the childhood disease and have natural immunity. Today, vaccines are the magic bullet, but we are no longer permitted to criticise them. However, there is still a body of evidence that indicates that getting childhood diseases had an important role in preventing various cancers in adulthood. For what it is worth, here are some links, some a bit technical, but included is a more readable account:
https://www.sciencedirect.com/science/article/pii/S030698779890055X
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2951028/
https://www.news-medical.net/news/20180522/Childhood-leukemia-linked-to-lack-of-childhood-infections.aspx
“Lack of infections during childhood is a common trend in obsessively clean environments that the babies grow up in today. According to Prof Mel Greaves from the Institute of Cancer Research in London, winner of the Royal Society’s prestigious Royal Medal, childhood leukemias are caused not just due to aberrant genetics or due to exposure to dangerous radiation but also due to lack of common infections during childhood that help build immunity. Greaves’s theories and evidence from the earlier works have been released in a paper that was published in the latest issue of the journal Nature Reviews Cancer. His work compiles information from globally situated experts in cell biology, immunology, genetics, childhood leukemia and epidemiology.