Can I prevent infection with an STD after unprotected sex?

Can't prevent. After the fact...Hopefully you come out unscathed and use better judgement next time.
No. Once infection has occurred (i.e. Once sex has occurred), you cannot uninfect yourself. Protect yourself before and during sex, not after.

Related Questions

After having unprotected sex, I've been having pain while urinating, could this be simply a infection or a std? Is the only way to know, waiting?

See below. Burning with urination (aka dysuria) suggests either infection (UTI or STD) or inflammation (e.g. Non-bacterial prostatitis). Post-sex simple UTI/bladder infection quite common in females but not in males and would be concerned about possible STD (chlamydia, GC) especially if discharge from penis or just prostate inflammation. Would recommend urinalysis, urine culture, and urine for GC/Chlamydia.

How can I prevent an STD after I have unprotected sex?

Too late. After sex, is exactly the wrong time to think about pretection from getting an std. The only sure way to not get an std is to not have sex. That includes oral and anal sex which also have risks. Use protection always and have sex with limited partners and have each get tested often to know their status.
Can't prevent. After the fact...Hopefully you come out unscathed and use better judgement next time.

Can I get std from having unprotected sex even if my partner and I are both virgins? Also I keep getting jock itches. Is there a prevention for it?

Tinea? Yeast? Other? It is not possible to have an STD unless one person or the other has had sex with someone else. "Jock itch" is not a term normally used in women, only men. Have you been diagnosed with tinea (same fungus group as jock itch in men)? Yeast (entirelydifferent)? Neither yeast nor tinea is sexually transmitted. Don't assume any diagnosis based only on symptoms; get professional care.

What medication can you take to prevent std's after unprotected sex?

None. Unfortunately, there is no medication that can totally prevent the acquisition of std's. Forethought regarding the type of partner you are sharing 'bodily fluids' with is tantamount in addition to contraceptives.

Having unprotected sex with two different men, I always get yeast infections. Why? And what can I do to prevent it?

Chronic Yeast. There could be several causes for this. It could be coincidental to sex...And be from something else you are ingesting. It could be irritation from the lubricant or the condom. You may be allergic to something and the irritation in the vaginal cavity reacts with a yeast overgrowth. Your gynecologist may need to do some testing and to put you on effective treatment.

If you had unprotected sex with someone who might have hiv. Are there preventative treatments/pills you can take to prevent HIV infection?

Get to your doctor. Unfortunately there is no 'preventive medicine' for hiv. If the person you were with did not disclose to you their HIV status, that is a legal matter and a very serious one at that. Get to your doctor asap and get tested regularly.
NPEP. This is what is called non-occupational post exposure prophylaxis, a combination of pills (tenofovir/emtricitabine/raltigravir) can be taken within 72 hours of exposure to the HIV virus for about a month (if the virus is not resistant to this combination), this can decrease the chance of getting infected; however the best protection is abstinence or the use of a condom, see a doc for evaluation.