Men who have sex with men (MSM) are quite adept at changing behavior as needed. Before HIV was even identified as the cause of AIDS, it was known from the basic epi that unprotected anal intercourse was a high risk activity. There was a grassroots effort to (among other things) encourage condom use, and a dramatic shift towards using condoms. It's only with the subsequent generations of MSM who did not see their friends die (thanks to better medications starting) that condom use started waning. A similar behavior shift happened after 2012, when HIV PrEP was found to be effective.
If you're interested in this topic, there's a couple of really good documentaries about the early HIV epidemic and how gay men adapted: "how to survive a plague" and "we were here" are two of my favorites.