How do I prevent a uti or yeast infection?

I was doing anal and his penis accidentally slipped in my ass and then my vagina. How do I prevent a UTI or yeast infection the next day??