In my previous three posts about Muslims and HIV/AIDS I stressed the importance of compassion to those who have been diagnosed with HIV or AIDS. Allah SWT will forgive any sin that is sincerely repented for and we should strive also to show mercy and kindness to those who are struggling both with AIDS and with trying to lead an upright life according to the tenets of Islam.
But we also need to look at the aspect of prevention. Among the major risk factors for infection are sexual promiscuity (heterosexual as well as homosexual) and intravenous drug use.
Islam commands believers to follow a rule of chastity, which means celibacy outside of marriage, and fidelity in it. The Islamic social code is set up to make it easier for us to follow this strict rule by limiting the avenues of temptation. By observing modest dress and by avoiding privacy, unnecessary physical contact, and intimate conversations with members of the opposite sex that we are not married or related to, inshallah we will find it easier to uphold the rule of chastity.
Another thing that Islam prohibits is all forms of intoxicants, both alcohol and drugs.
By following these rules ourselves and by encouraging others to follow them as well we can, by permission of Allah SWT, put the brakes on the spread of AIDS into Muslim communities.
Here are two articles about this, one from an Islamic scholar and one from a Muslim doctor.