This talk is dedicated to the control of epidemic dynamics, by the population or a global planer. We will first investigate how epidemic dynamics can be controled by the population itself, trough the aggregation of individual decisions of social distancing reduction in response to the virus prevalence. This leads to a mean field game formulation of the problem where, in particular, the Nash equilibrium provides a global control of dynamics largely differing from the social optimum one. We will then investigate the control of epidemic dynamics from the point view of a global planer balancing sanitary and social/economic cost, while facing ICU capacity constraints. In a dedicated SIR type model, we numerically derive the optimal social distancing strategy in such context and study its robustness through variations of the dynamics parameters. The presentation is based on joint works (here & there) with Arthur Charpentier, Emma Hubert, Mathieu Laurière, Viet Chi Tran and Gabriel Turinici.