There is no vaccine for hepatitis D, but you can prevent HDV infection by getting vaccinated for hepatitis B. Because HDV needs HBV to make copies of itself, by avoiding hepatitis B, you will avoid hepatitis D.
For those with chronic hepatitis B infection (or those with HBsAg in their blood), there is no vaccine, but avoiding direct contact with infected blood will prevent exposure to hepatitis D. This would include sharing dirty needles, having unprotected sex, and sharing personal items that may have infected blood on them such as razors and toothbrushes.