Sti’s

If I’m a virgin can I get an sti? Do you have to have anal or penis in vagina sex to get one? This has always confused me