Antibiotics can treat STDs caused by bacteria or parasites. There is no cure for STDs caused by viruses, but medicines can often help with the symptoms and lower your risk of spreading the infection. Correct usage of latex condoms greatly reduces, but does not completely eliminate, the risk of catching or spreading STDs. The most reliable way to avoid infection is to not have anal, vaginal, or oral sex. There are vaccines to prevent HPV and hepatitis B.