How can I treat vaginal discharge with a foul odor?

See your doctor. I recommend seeing your healthcare professional to treat you appropriately as this is likely a bacterial infection. Wishing you the very best.