Uti or yeast infection

It hurts to pee and I have had both before I was sure it was a uti because it stung to pee and I had to pee frequently but I had sex this morning I know not a good idea but it hurt like a yeast infection so now I’m stuck on which I have and I don’t know what medicine to take 😭