These cycles of mass and energy are often done in part through the movement of gases, of which specific physical properties are related to one another in what is known as the ideal gas law:
PV = nRT
Where P is pressure (in atm), V is volume (in L), n is moles (amount of particles), T is temperature (in K), and R is the ideal gas constant (which is equal to 0.08206 L atm / mol K). There's also a few important special things to remember. The first is STP, which stands for standard temperature and pressure, equal to 1 atm and 273 K. The other is room temperature, equal to 298 K.
This is called the ideal gas law since it does not take into account anything related to the gas used or any intermolecular forces that would influence the gas. It's only really accurate when gas is spread out far enough to not smash against itself but for our purposes this is fine; we're just looking at the general trends. With the ideal gas law 1 mole of gas particles has a volume of 22.4 liters at STP.
Since R is a constant, we can use this formula to compare the initial states and final states of a gas (after it changes somehow) by rearranging it.
P1 V1 / n1 T1 = P2 V2 / n2 T2
If other variables are constant as well then the gas law breaks down into multiple formulas:
Boyle's changes Pressure and Volume; Moles and Temperature are constant
Example- When scuba diving, bubbles get larger as they approach the surface since there's less pressure on them.
Charles' changes Volume and Temperature; Moles and Pressure are constant
Example- A hot air balloon becomes less dense than air when heat is applied to the air inside the balloon because the balloon's air expands.
Gay-Lussac's changes Pressure and Temperature; Moles and Volume are constant
Example- A pressure cooker can use extreme pressures to heat food enough to cook it!
Avogadro's changes Volume and Moles; Pressure and Temperature are constant
Example- Balloons shrink when air is released from them.
For gases, their constant motion and the large distance between particles means the forces of attraction between the particles within it are very small. This means we can use the ideal gas law (PV = nRT) combined with stoichiometry when dealing with gases to determine how much is produced. Since we need moles for our stoichiometry, the ideal gas law rearranges to be:
(Pressure in atm * Volume in liters) / (Temperature in Kelvin * 0.08206) = moles