How and when was the $\mathsf{CO_2}$ scrubbed when Earth was still primordial?
As you probably realise, the Earth's early atmosphere was mainly composed of CO2, as are the atmospheres of Mars and Venus to this very day. You are right in thinking that most of this CO2 was removed by biological activity; if all the earth's fossil fuels and limestone rocks were converted back into CO2, we would have an atmosphere similar to that which existed nearly 4 billion years ago. It was this same biological activity which built up the oxygen level to its present 21 percent. The process continues right up to the present day. The CO2 content of the atmosphere is to some extent self regulating: the higher the levels, the more vigorously plants and photosynthetic micro-organisms grow, extracting more and more carbon dioxide from the atmosphere, but this natural process could be swamped if the build-up of CO2 exceeded the capacity of plants to remove it. It is not generally known that algae and phytoplankton in the sea remove more CO2 and generate more oxygen than all the rainforests.