To avoid a second UTI, wait about two weeks after a UTI clears before having sex.