In this letter, we propose an epidemic model over temporal networks that explicitly encapsulates two different control actions. We develop our model within the theoretical framework of activity driven networks (ADNs), which have emerged as a valuable tool to capture the complexity of dynamical processes on networks, coevolving at a comparable time scale to the temporal network formation. Specifically, we complement a susceptible-infected-susceptible epidemic model with features that are typical of nonpharmaceutical interventions in public health policies: i) actions to promote awareness, which induce people to adopt self-protective behaviors, and ii) confinement policies to reduce the social activity of infected individuals. In the thermodynamic limit of large-scale populations, we use a mean-field approach to analytically derive the epidemic threshold, which offers viable insight to devise containment actions at the early stages of the outbreak. Through the proposed model, it is possible to devise an optimal epidemic control policy as the combination of the two strategies, arising from the solution of an optimization problem. Finally, the analytical computation of the epidemic prevalence in endemic diseases on homogeneous ADNs is used to optimally calibrate control actions toward mitigating an endemic disease. Simulations are provided to support our theoretical results.