Hi learningthings, thank you for reaching out! Birth control can prevent pregnancy, but it does not prevent any risk of infection. Are you on birth control? Do you know what infection your friend had specifically? Sometimes people get urinary tract infections (UTIs) after sex, so it is recommended that you drink a lot of water and urinate after intercourse. Here is some more information on the correlation of birth control and UTIs in case if you want more information on your friend's situation and how to prevent a UTI:
UTI from birth control? What are my other options?.
Now, back to you! Yes, your first time can be painful and cause blood, and even some times after that, so it is extremely important to prepare yourself both physically and mentally. This means to create a safe and comfortable environment, relax, and communicate with your partner. I do want to emphasize that everyone's experience with intercourse is different and you know your body better than anyone! Everyone's pain threshold is different, so try to consistently communicate with your partner during intercourse. Additionally, there is foreplay, which can also help with preparing you and your partner for intercourse. It can also assist with alleviating possible pain. Here is a good article with more information on that:
What is foreplay?. Lastly, please check out this article from us if you haven’t already:
First Intercourse 101, I think it will definitely expand on my responses to your questions.