Understanding the impact of human behavior on the spread of infectious diseases might be the key to developing better control strategies. Tuberculosis (TB) is an infectious disease caused by bacteria that mostly affects the lungs. TB remains a global health issue due to its high mortality. The paper proposes a spatiotemporal discrete tuberculosis model, based on the assumption that individuals can be classified as susceptible, exposed, infected, and recovered (SEIR). The objective of this work is to introduce a strategy of control that will reduce the number of exposed and infected individuals. Three controls are established to accomplish this. The first control is a public awareness campaign that will educate the public on the signs, symptoms, and treatments of tuberculosis, allowing them to seek treatment if they are at risk. The second control initiates chemoprophylaxis efforts for people who are latently infected, and the third control characterizes the treatment effort for people who are actively infected. We have shown the existence of optimal controls to give a characterization of controls in terms of states and adjoint functions by using Pontryagin's maximum principle. Using numerical simulations, our results indicate that awareness campaigns should be combined with treatment and chemoprophylaxis techniques to reduce transmission. As a result, it demonstrates the efficacy of the suggested control strategies in reducing the impact of the disease.