When and How to Quarantine