You should always quarantine things. Even if you have never had a problem before, there is always a chance something could go wrong. As far as how to, buy a second tank. Perhaps upgrade your small one to a bigger one and use the small one for a quarantine tank. I have a feeling the shrimp was carrying something that killed off your fish. Something that killed that fast could be columnaris, while it won't affect your shrimp, it will kill your entire tank in a matter of days if not treated for. Sadly it's becoming more and more common in the pet industry. Even though its a pain for me to keep a second tank running, I will never take it down because nothing goes into my tank with out being first quarantined. It's just not worth the risk to skip this step
"And 5, very important 5... Don't let me eat pears.. I HATE PEARS."