Sexually Transmitted Infections (STIs) are infections passed on through sex, especially if you don't use a condom. Some infections, like herpes, are passed on by genital skin-to-skin contact.
The only way to avoid getting an STI is to not have sex. If you choose to have sex, the best way to protect yourself from getting an STI, or passing on an infection, is to use a condom every time you have sex.
You can get lots of condoms on a prescription from your GP or from another clinic, or you can buy them at a pharmacy or supermarket. Most sexual health/STI clinics will give you some free condoms - ask your local clinic. Family Planning clinics have female condoms as well.