Thank you for this question!
There is some evidence that being circumcised (i.e., not having a foreskin) can decrease your risk of getting and giving HIV and other STBBIs.
Although this data does exist, Canada Paediatric Society does not recommend newborn circumcision to reduce STBBI transmission. Circumcision is not recommended as an HIV prevention method in Canada. There are many other effective ways to reduce and prevent STBBI transmission, and it is not necessary to get circumcised in order to prevent transmission. (See fs-prev-circumcision-en-27-04-2018.pdf (catie.ca) for more information)
Foreskin is very thin and delicate skin, which means that it is more likely to get abrasions/cuts. Foreskin also creates a space between the shaft skin of the penis and the foreskin itself. It is important to keep this space as clean as possible. This space is warm and contains a lot of moisture, so it’s a place where bacteria and other pathogens can grow. It is important to keep the foreskin and area underneath clean, and to take care to observe any cuts/lesions on or underneath the foreskin. The frenulum (the small piece of skin attaching the foreskin to the head of the penis) is also very fragile.
The best and most proven way to not transmit STBBIs is to use barrier methods like a condom, and get tested regularly so you know your status! You can also use lubricant to help prevent condoms from tearing, or from skin getting irritated and inflamed from chafing.