Yes. The only way to have no risk of a pregnancy is to not have sex (abstinence). If you decide to have sex, using birth control will reduce the risk of becoming pregnant.
Birth control only works if you use it correctly every time you have sex. Some birth control prevents pregnancy better than others and only condoms reduce the risk of sexually transmitted infections, including HIV.