Here, I have illustrated a classic inert gas reaction setup. You can follow the flow of N2 to the condenser where it eventually gets pushed out, ensuring little to no oxygen can enter.The flow must be calibrated as such that nitrogen does not push out reaction products or solvents that we don't want pushed, to this a end a bubbler can be attached between the canister and flask to visualize the flow of gas.N2 is used in this way in official settings since it is readily available and cheap, but also light, so it needs to be flowing to not be replaced with athmospheric air.
We need only to use our imagination to apply this to our amateur setting.A gas that is inert and by contrast to N2 is much heavier is Argon, it is more expensive and is much rarer, but available.Argon can be used this way by only filling your reaction medium using a canister and optionally pulling a vacuum at the end of the condenser and refilling with argon.