In this article, we present a mathematical model for human immunodeficiency virus (HIV)/Acquired immune deficiency syndrome (AIDS), taking into account the number of CD4+T cells and antiretroviral treatment. This model is developed based on the susceptible, infected, treated, AIDS (SITA) framework, wherein the infected and treated compartments are divided based on the number of CD4+T cells. Additionally, we consider the possibility of treatment failure, which can exacerbate the condition of the treated individual. Initially, we analyze a simplified HIV/AIDS model without differentiation between the infected and treated classes. Our findings reveal that the global stability of the HIV/AIDS-free equilibrium point is contingent upon the basic reproduction number being less than one. Furthermore, a bifurcation analysis demonstrates that our simplified model consistently exhibits a transcritical bifurcation at a reproduction number equal to one. In the complete model, we elucidate how the control reproduction number determines the stability of the HIV/AIDS-free equilibrium point. To align our model with the empirical data, we estimate its parameters using prevalence data from the top four countries affected by HIV/AIDS, namely, Eswatini, Lesotho, Botswana, and South Africa. We employ numerical simulations and conduct elasticity and sensitivity analyses to examine how our model parameters influence the control reproduction number and the dynamics of each model compartment. Our findings reveal that each country displays distinct sensitivities to the model parameters, implying the need for tailored strategies depending on the target country. Autonomous simulations highlight the potential of case detection and condom use in reducing HIV/AIDS prevalence. Furthermore, we identify that the quality of condoms plays a crucial role: with higher quality condoms, a smaller proportion of infected individuals need to use them for the potential eradication of HIV/AIDS from the population. In our optimal control simulations, we assess population behavior when control interventions are treated as time-dependent variables. Our analysis demonstrates that a combination of condom use and case detection, as time-dependent variables, can significantly curtail the spread of HIV while maintaining an optimal cost of intervention. Moreover, our cost-effectiveness analysis indicates that the condom use intervention alone emerges as the most cost-effective strategy, followed by a combination of case detection and condom use, and finally, case detection as a standalone strategy.