The best way to prevent hepatitis B is by getting the hepatitis B vaccine. The hepatitis B vaccine is safe and effective and is usually given as 3-4 shots over a six month period. Hepatitis B vaccination is recommended for: Hepatitis B is a very safe vaccine. Most people do not have any problems with it but a vaccine, like any medicine, could cause a serious reaction.