The only way to 100% guarantee that you will not get pregnant is abstinence (no sex). Realistically, birth control pills (99.5% effective) or condoms (98% effective) are your best alternatives. For any method to be effective at preventing pregnancy, you must adhere to its instruction.
To specifically answer your question, if you decide to use condoms, you need to use it every time to achieve maximum efficacy.