



You may have a combination of what you have created for yourself - poor, or non-existent genital hygiene - and an infection you received during the sex.
Infections are most often bacterial for anal or receiving oral, or yeast / fungal for penetrative vaginal.
What a doctor or sexual health specialist would do is to prescribe a course of antifungal or antibacterials based on the type of sex you had - obviously if you were at risk of both types you would be given medication for both