A pandemic is an epidemic spread over a huge geographical area. COVID-19 is 5 th such pandemic documented after 1918 flu pandemic. In this work, we frame a mathematical epidemic model taking inspiration from the classic SIR model and develop a compartmental model with ten compartments to study the coronavirus dynamics in India and three of its most affected states, namely, Maharashtra, Karnataka, and Tamil Nadu, with inclusion of factors related to face mask efficacy, contact tracing, and testing along with quarantine and isolation. We fit the developed model and estimate optimum values of disease transmission rate, detection rate of undetected asymptomatic, and the same of undetected symptomatic. A sensitivity analysis is presented stressing on the importance of higher face mask usage, rapid testing, and contact tracing for curbing the disease spread. An optimal control analysis is performed with two control parameters to study the increase and decrease of the infected population with and without control. This study suggests that improved and rapid testing will help in identifying more infectives, thereby contributing in the decline of disease transmission rate. Optimal control analysis results on stressing on the importance of abiding by strict usage of face mask and social distancing for drastic decrease in number of infections. Time series behaviour of the symptomatic, asymptomatic, and hospitalized population is studied for a range of parameters, resulting in thorough understanding of significance of different parameters. © 2021, The Author(s), under exclusive licence to Springer Nature Switzerland AG.