If you have sex w/someone who has an STD, will you contract the disease right after the first time? Is it possible to have sex with someone with an STD and not get it as well?

Jay 🥀 • my guilty pleasure is listening to "if we were a movie" by Hannah Montana

Don't worry, I'm not planning on doing so. I was just wondering