The only thing that is 100% sure to prevent pregnancy is Abstinence!
However, in today society abstinence is rare so practice safe sex... condoms (free at health department) and birth control are the best way to go. Please do not depend on peeing after sex to prevent pregnancy because you will end up pregnant... stay away from pull n pray method.