An epidemiological compartmental model was used to simulate social distancing strategies to contain the COVID-19 pandemic and prevent a second wave in São Paulo, Brazil. Optimization using genetic algorithm was used to determine the optimal solutions. Our results suggest the best-case strategy for São Paulo is to maintain or increase the current magnitude of social distancing for at least 60 more days and increase the current levels of personal protection behaviors by a minimum of 10% (e.g., wearing facemasks, proper hand hygiene and avoid agglomeration). Followed by a long-term oscillatory level of social distancing with a stepping-down approach every 80 days over a period of two years with continued protective behavior.