Hepatitis B is a virus that infects the liver and can cause chronic liver disease and liver cancer; you receive 3 doses as a baby, then a booster shot (a dose to remind your immune system of how the virus looks like) as an adult if you are at risk of exposure to the virus, like working in a hospital or hospice with sick patients.
Hepatitis B infection is transmitted through contaminated needles or any other instruments that have gone into the blood of a person with the infection then goes into your bloodstream, like other sharp objects (blades for example). It's also transmitted in blood transfusion (contaminated blood from a donor) and through sexual intercourse.
Hepatitis B vaccine contains yeast (main ingredient) in addition to other components (like dextrose and amino acids). It's giveniin the muscles (intramuscular injection) and is not considered to carry a nutritional value. But since it's like a medication, you're not supposed to fast and receive the vaccine, especially that the injection may cause a local reaction in which case you may need medication for pain.