https://www.battlefields.org/learn/articles/washington-inoculates-army#:~:text=Washington%20chose%20to%20have%20his%20soldiers%20inoculated%20during,from%20the%20effects%20of%20inoculation%20before%20fighting%20commenced.
https://www.mountvernon.org/library/digitalhistory/digital-encyclopedia/article/smallpox/
https://www.loc.gov/rr/scitech/GW&smallpoxinoculation.html
The soldiers were deliberately infected with a weak strain of the virus (Chicken Pox). This made it so their bodies were resistant to similar diseases, like Smallpox.
Later, this practice was developed further, leading to the true Smallpox vaccine and then to vaccines as we know them today.