Hepatitis B is one of the leading causes of morbidity and mortality, affecting hundreds of millions of people worldwide. Thus, this paper focuses on three control measures as the best way to intervene against the hepatitis B viral infection. These measures are condom use, testing and treatment, and vaccination to stop the disease from spreading over a community. The model comprises seven (7) compartments that include susceptible individuals, latent individuals, acute-infected individuals, chronic-infected individuals, infected by carrier individuals, recovered individuals from the disease, and the vaccinated population. We mathematically established a nonlinear differential equation to study the dynamics of the model. The disease-free equilibrium (DFE) and endemic equilibrium (EE) are reached. The basic reproduction numbers,
R
0
A
,
R
0
H
, and
R
0
C
, determine the transmission of the disease and thus are gotten. We perform sensitivity analysis on the reproduction numbers to identify the factors that affect the reproduction numbers. The results of the sensitivity analysis paved a way for introducing a controlled system which was solved using Pontryagin’s maximum principle (PMP) and the optimality system got. The optimality system was then solved numerically using the forward and backward sweep approach, and graphs were generated, establishing the conditions for local and global stability of the disease-free equilibrium using the Routh-Hurwitz criterion and Castillo-Chavez approach, respectively. We also used Pontryagin’s maximum principle to determine the optimality system. The result of the analysis of the stability of the disease-free equilibrium states that hepatitis B virus can be completely wiped out if the rate of infection is kept at a number less than unity. A numerical simulation of the model was carried out and showed that hepatitis B virus transmission can best be controlled when condom use, testing and treatment, and vaccination are implemented.