HIV/AIDS has a strong impact on society, the economy, and health. Early diagnosis of cases, adherence to treatment, and prevention are important factors in controlling the epidemic in the population. In this paper, we present a new mathematical model for the study of HIV/AIDS transmission. Our model is stratified in men and women, to account for the main forms of sexual transmission homosexual and heterosexual relationships, and infectiousness in the HIV and AIDS stages. In addition, in the construction of the model, we take into account the influence of Pre-Exposure Prophylaxis (PrEP) and Post-Exposure Prophylaxis (PEP) to study the impact of these implementations, diagnosis, and effectiveness of treatment based on viral load undetectability. We study the basic reproduction number by subpopulation (men and women) and general. Working by subpopulations allows us to study men who have sex with men who have a strong impact on virus transmission. Also, we study the infection-free equilibrium points due to their relationship with the basic reproduction number and demonstrate the global stability by subpopulation and general. To explore our model, we performed computational simulations on a scenario designed with data from the literature and assumed, studying the influence of the parameters associated with the use of PrEP, PEP, and undetectability on the basic reproduction number by varying them individually and jointly. We concluded that in women the basic reproduction number is always lower than unity and that in men the parameter associated with the undetectability of the viral load in HIV men has a strong influence on the dynamics. We also address the impact of PrEP, PEP, and undetectability in HIV and AIDS on the compartments, considering different scenarios varying the parameters jointly and independently and by sex which show difficulty in reducing women with AIDS. The scenario that showed the best results in the reduction of the number of HIV and AIDS cases was when the parameters associated with undetectability in HIV and AIDS men and women take the 90-90-90 that is proposed in the World Health Organization (WHO) strategy.