Lockdowns are the only solution for stopping the spread of an infectious virus or bacteria. How you implement the lockdown and how long for depends on the infection rates and treatment requirements.
If everyone masked/maintained hygiene/social distanced, then lockdowns can be lessened, but the best way to stop infections is to stop providing the environment were infections can occur.
Unless there are both effective and scalable treatment options, then some form of isolation is the only alternative.