if you look at what countries that have controlled this are doing. they identify cases as rapidly as possible. that involves fast testing. when a case is identified that person is quarantined (or hospitalized, as necessary). everyone that person has contacted is traced and tested/quarantined/retested. notifications are put out so that anyone that thinks they were near that person can come in for testing. the key at every step is to move fast, to get people isolated before they have an opportunity to infect anyone else.
a lot of these countries don't have a huge capacity for testing. the capacity for testing needed is related to the population of infected as much or more so than it is the country's population. unfortunately we have a very large population of infected people.
related to that. to come out of the lockdown, we need to have r = 1.0 or less. however it's important to realize that implies continued transmission of an appreciable fraction of the current number of infected people. in many parts of the country, that's fine - there isn't currently a large population of infected people. however in somewhere like ny/nj, there are millions of infected. a lockdown will have to be kept in place much longer, to reduce the infected population, than it will in places where the virus never spread widely.