Within a space vessel such as the ISS for example, how do the astronauts regulate the level of CO₂ they are breathing and how is the air scrubbed exactly?
The US side of ISS uses a cyclic machine called the Carbon Dioxide Removal Apparatus (CDRA) to absorb CO2 from the air and then vent it to space.
You can read about the cycles of the CDRA in this answer and its linked references.
Older spacecraft used lithium hydroxide (LiOH) canisters, which were a disposable item, and therefore more problematic for the ISS.
US spacesuits used to use LiOH as well, but in recent years have turned to a regenerable metal oxide (Metox) system. This answer has links to more info about Metox.