Thank you for your question.
It appears from your description that you might have a vaginal as well as a urinary infection. You will need to see your gynaecologist for examination, tests and a prescription to treat the infection. Ideally both you and your sexual partner need to be assessed and treated together. You should avoid intercourse till you are completely better. One way to prevent urine infections after intercourse is to empty the bladder before and after sex. When you clean the genitals remember to clean only from front to back to avoid contaminating the vagina or urethra with bacteria from the bowel. Also remember to use condoms to prevent infections and additional contraception if you do not wish to get pregnant just yet. Your gynaecologist can help you with this.