Advice please

Me and my bf have gotten close to having sex but I’ve been set in waiting til marriage. More recently I’ve been tempted to break that. However I’m in highschool and I don’t know the proper stuff to avoid pregnancy besides a condom and condoms aren’t always effective/can still get pregnant. Any suggestions/advice? Please!