yeast infection

im 15 and have had sex with protection and i have a yeast infection , i’ve had it for a good few days now and i’m treating it with a cream but i just wanted more insight on how i could’ve possibly gotten it and i wanted to know if you guys have had any in the past ? it’s not comfortable at all and my vulvar is swollen and itchy and my discharge is clumpy