The treatment depends on the type of STI. For some STIs, treatment may involve taking medicine or getting a shot. For other STIs that can't be cured, like herpes, treatment can help to relieve the symptoms.
Only use medicines prescribed or suggested by your doctor. There are products sold over the Internet that falsely claim to prevent or treat STIs, such as herpes, chlamydia, human papillomavirus, and HIV. Some of these drugs claim to work better than the drugs your doctor will give you. But this is not true, and the safety of these products is not known.
This answer is based on source information from National Women's Health Information Center.