"preventive treatment of disease, a guarding against the attack of some disease," 1746, Modern Latin, from Greek prophylassein "to keep guard before," from pro "before" (see pro-) + phylassein "to watch over, guard" (see prophylactic).
word-forming element meaning "forward, forth, toward the front" (as in proclaim, proceed); "beforehand, in advance" (prohibit, provide); "taking care of" (procure); "in place of, on behalf of" (proconsul, pronoun); from Latin pro (adv., prep.) "on behalf of, in place of, before, for, in exchange for, just as," which also was used as a first element in compounds and had a collateral form por-.
Also in some cases from cognate Greek pro "before, in front of, sooner," which also was used in Greek as a prefix (as in problem). Both the Latin and Greek words are from PIE *pro- (source also of Sanskrit pra- "before, forward, forth;" Gothic faura "before," Old English fore "before, for, on account of," fram "forward, from;" Old Irish roar "enough"), extended form of root *per- (1) "forward," hence "in front of, before, toward, near," etc.
The common modern sense of "in favor of, favoring" (pro-independence, pro-fluoridation, pro-Soviet, etc.) was not in classical Latin and is attested in English from early 19c.
1570s, of medicines, "that tends to prevent or defend from disease," from French prophylactique (16c.) and directly as a Latinized borrowing of Greek prophylaktikos "precautionary," from prophylassein "keep guard before, ward off, be on one's guard," from pro "before" (see pro-) + phylassein, Ionic variant of phylattein "to watch over, to guard," but also "cherish, keep, remain in, preserve," from phylax "guard," a word of unknown origin.
The noun is first recorded 1640s, "a medicine or treatment to prevent or defend against disease;" meaning "condom" is from 1943, replacing earlier preventive (1822), preventative (1901). Condoms originally were used more to thwart contagious disease than to prevent pregnancy. Related: Prophylactical.
<a href="https://www.etymonline.com/word/prophylaxis">Etymology of prophylaxis by etymonline</a>
Harper, D. (n.d.). Etymology of prophylaxis. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/prophylaxis